General
These are utility methods that can be used to query or modify VCollab status.
xMessageBox
Display user messages from python as a dialog box and log them in VCollabPro application log file. This function is useful for debugging Python scripts. This function can be used to display error status, returned from an API function.
void xMessageBox(String sMsg, bool bPopup)
sMsg
Message to be Displayed.
bPopup
When True
, a popup message will be displayed. User needs to select
ok to continue after this message. This option is useful while
testing/debugging.
When False
, the message will be displayed only in the log file.
xGetLastError
To get the error message from the last VCollab API callback function.
String xGetLastError()
return
Returns status string for the last executed API method, whether it was successfully executed or failed.
xSetWindowSize
Resizes viewer window.
bool xSetWindowSize(int iWidth, int iHeight)
return
Returns True
, if successful
iWidth, iHeight
Width and height of the new window
pxGetWindowSize
Gets current viewer window size.
List<int> pxGetWindowSize()
return
Returns width and height in an array of size two.
xLockRefresh
Sets flag to enable or disable viewer to refresh Viewer screen, It will be used as a set of API calls are called a group.
void xLockRefresh(bool bLockRefresh)
bLockRefresh
If set to True
, all refresh call for the viewer will be skipped.
xIsRefreshLocked
Checks if the refresh is locked or not.
bool xIsRefreshLocked()
xLockSnapShot
Sets flag to enable or disable taking of snapshots for undo/redo.
void xLockSnapShot(bool bLockSnapShot)
bLockSnapShot
If set True
, capturing all undo-redo snapshots will be skipped.
xIsSnapShotLocked
Checks if snapshot for undo/redo is locked or not.
bool xIsSnapShotLocked()
return
Returns True
if the snapshot is locked.
xRefreshViewer
Refreshes viewer window.
bool xRefreshViewer()
return
Returns True
if successful, returns false if the refresh is locked
xQuitScript
Quits python script execution.
void xQuitScript()
xCopyToClipBoard
This method copies viewer window pixels as clipboard image.
bool xCopyToClipBoard (ushort iColorPlotMode)
return
Returns True
, if successful.
iColorPlotMode
Set the color plot mode for CAE models.
0 - Forces color plot to OFF.
1 - Forces color plot to ON.
2 - Scene As-Is.
xGetVersion
Gets current VCollabPro’s file version.
String xGetVersion(void)
return
Returns VCollab Pro’s file version. Like 4.9.216.529
Where 4 is major version. 9 is minor version. 2 is the build number. 16 is year of build. 5 month of the build. 29 is the date.
xIs64bit
Checks for the 64-bit build.
bool xIs64bit(void)
return
Returns True
, if VCollab Pro is a 64 bit executable.
xIsGUIMode
Identifies the execution model as GUI mode or batch mode.
bool xIsGUIMode()
return
Returns True
, if current execution mode is in GUI mode.
xShowToolBar
Show/Hide the main Toolbar.
bool xShowToolBar(bool bShow)
return
Returns True
, if successful.
bShow
Set True
to show the toolbar.
xIsToolBarVisible
Checks the main toolbar’s visibility.
bool xIsToolBarVisible(void)
return
Returns True
, if visible.
xShowStatusBar
Show/Hide the main status bar’s visibility.
bool xShowStatusBar(bool bShow)
return
Returns True
, if successful.
bShow
Set True
to show the status bar.
xIsStatusBarVisible
Checks the main status bar’s visibility.
bool xIsStatusBarVisible(void)
return
Returns True
, if visible.
xExportProfile
Exports current settings in a profile file. Supported extension .ini
bool xExportProfile(const String sFileName)
return
Returns True
, if successful.
sFileName
Target ini file
xRefreshNormals
Forces scene to update normal for lighting calculations.
bool xRefreshNormals ()
return
Returns True
, if successful.
xRefreshDialogs
Python script doesn’t set values in dialogs every time. To set the values, Use this method to Refresh all dialogs for the applied values. VCollab Pro updates values only when this method is called.
void xRefreshDialogs(void)
xGetLogPath
Gets application’s the Logfile name with full path.
String xGetLogPath()
return
Returns logfile name along with its full directory path.
xGetProfilePath
Gets application’s Profile directory path.
String xGetProfilePath()
return
Returns profile file directory name with the full file path.
xGetOpenGLVersion
Gets the OpenGL version the application is using.
String xGetOpenGLVersion()
return
Returns OpenGL version accessed by the application currently.
xSetLogEnable
Enables or disables writing info in VCollab log file.
void xSetLogEnable(bool bEnable)
bEnable
Enable flag parameter.
xIsLogEnabled
Gets info on if the application writes a log file or not.
bool xIsLogEnabled()
return
Returns True
, if logfile writing is enabled. (default)
Returns False
, if logfile writing is disabled.
xMakeMovie
Creates a movie file from all image files in a folder.
String xMakeMovie(String sImgsFolderName, String sMovieFileName, int iSpeedFactor)
return
Returns empty String or error message, if failed.
Returns success message, if succeed.
sImgsFolderName
Folder path where the indexed images are stored.
sMovieFileName
Output movie file name with full path and extension. Supported formats are gif, mp4, avi, flv, swf and wmv.
iSpeedFactor
Default Speed Factor is 0. User can control the speed by changing it between -4 and 3.
Note: Supports jpg, tif, png and bmp input image file formats. The maximum number of files with the common name of the same format becomes input files.
xBlockPopups
Blocks or unblocks application pop up message boxes.
bool xBlockPopups(bool bTrue)
return
Returns True
, if succeed.
Returns False
, if failed.
bTrue
True
– to block.
False
– to unblock.
xIsFontAvailable
Checks whether a given font is available or not and returns the Boolean flag.
bool xIsFontAvailable(String sFontFace)
return
Returns True
if the font is available with application.
Returns False
if not available.
sFontFace
Font face name.
xAddFont
Makes given font available to application by giving font face name and corresponding valid font file (*.ttf)
bool xAddFont(String sFontName, String sFilePath)
return
Returns True
if the font is added to application successfully.
Returns False
if failed.
sFontName
Font face name.
sFilePath
File path of true type font.
xSetStatusMsg
Sets user defined message in the status bar.
void xSetStatusMsg(String msg)
msg
Message to be displayed in the statusbar.
xSaveFilteredCAX
Filters and saves in new cax file as culled using nodeset manager.
bool xSaveFilteredCAX(String sFilePath, bool bEdge, bool bDeform, List<String> resultsArray)
return
Returns True
, if successful.
sFilePath
New cax full file path.
bEdge
Set True
to save all visible parts edge.
bDeform
Set True
to save deformation result.
resultsArray
Name of the Results to be saved.
xGetSuiteVersion
Gets the VCollab Suite version of the application.
String xGetSuiteVersion()
return
Returns the suite version string if it succeeds. Returns empty string otherwise.
xGetAppPath
Gets Application’s path.
String xGetAppPath()
return
Returns the application path.
xLogMessage
Helps user to write messages to application log file.
bool xLogMessage(String sMessage, bool bPopup)
return
Returns True if message is logged successfully.
Returns False otherwise.
sMessage
Message to be logged.
bPopup
If True, message will be popped up to the user.
If False, no message will be popped up.
xSetMouseMode
Set mouse mode to a specific function like Probe, Move Label, etch.
bool xSetMouseMode(int iMouseMode)
return
Returns True if mouse mode is set.
Returns False otherwise.
iMouseMode
0 - default mode
Note: Currently it sets to default mode only. This will be extended in future.
xGetCurMouseMode
Gets current mouse mode.
int xGetCurMouseMode()
return
Returns mouse mode index
0 - default.
iMouseMode
0 - default mode
xCaptureSnapShot
Captures current state.(Same as viewpoint but it is not part of any viewpoint list)
size_t xCaptureSnapShot()
return
Returns captures state id
xApplySnapShot
Applies a captured state.
bool xApplySnapShot(size_t iSnapShotID)
return
Returns True, if successful.
iSnapShotID
Captured state ID