pycatia.system_interfaces.system_service¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-09 09:53:18.676780
Warning
The notes denoted “CAA V5 Visual Basic Help” are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus help debugging in pycatia.
- class pycatia.system_interfaces.system_service.SystemService(com_object)¶
Note
CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectSystemServiceRepresents an object which provides system services.- environ(i_env_string)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Func Environ(CATBSTR iEnvString) As CATBSTRReturns the value of an environment variable.Parameters:iEnvStringThe name of the environment variableExample:This example retrieves the value of the PATH variable in the Valuestring.Value = CATIA.SystemService.Environ(“PATH”)
- Parameters:
i_env_string (str) –
- Returns:
str
- evaluate(i_script_text: str, i_language: int, i_function_name: str, i_parameters: list)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Func Evaluate(CATBSTR iScriptText,CATScriptLanguage iLanguage,CATBSTR iFunctionName,CATSafeArrayVariant iParameters) As CATVariantEvaluates a scripted function.Parameters:iScriptTextThe program textiLanguageThe language the program is written iniFunctionNameThe name of the function to invokeiParametersAn array of parameters for the functionoResultThe value returned by the function (if any)Example:This example executes the function CATMain from the CodeToEvaluatestringDim params()Dim codeToEvaluateCodeToEvaluate = “Sub CATMain()” & vbNewLine & _“MsgBox “ & chr(34) & “Hello World” & chr(34) &vbNewLine & _“End Sub”CATIA.SystemService.Evaluate CodeToEvaluate, CATVBScriptLanguage,“CATMain”, params
- Parameters:
i_script_text (str) –
i_language (int) – enum cat_script_language
i_function_name (str) –
i_parameters (list) –
- Returns:
None
- execute_background_processus(i_executable_path)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Func ExecuteBackgroundProcessus(CATBSTR iExecutablePath) AslongExecutes an asynchronous process. This process is launched in backgroundand ExecuteBackgroundProcess doesn’t wait for it to complete. If the executableto run needs a specific environment to works correctly (for example environmentvariables like PATH or LD_LIBRARY_PATH correctly set), this environment musthave been set in order to make this method succeed. If this executable needs tobe launched from a window, this method will fail.Parameters:iExecutablePathThe path of the executable to run and its arguments If the executable is not present inthe PATH environment variable, you must specify its complete absolute path. If this pathcontains blanks, you must enclose it with the simple quote character ‘’’ : for exampleCATIA.SystemService.ExecuteBackgroundProcess “‘C:/Program Files/myApp/myApp.exe’ myArg”.Returns:Non significative return code. It’s never the asynchronous processreturn codeExample:This example executes the command located atand doesn’t wait the end of its execution.CATIA.SystemService.ExecuteBackgroundProcessus “”
- Parameters:
i_executable_path (str) –
- Returns:
int
- execute_processus(i_executable_path)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Func ExecuteProcessus(CATBSTR iExecutablePath) As longExecutes a synchronous process. If this process is succesfully launched,ExecuteProcessus waits for it to terminate and returns the process return code.If the executable to run needs a specific environment to works correctly (forexample environment variables like PATH or LD_LIBRARY_PATH correctly set), thisenvironment must have been set in order to make this method succeed. If thisexecutable needs to be launched from a window, this method willfail.Parameters:iExecutablePathThe path of the executable to run and its arguments. If the executable is not present inthe PATH environment variable, you must specify its complete absolute path. If thisexecutable path contains blanks, you must enclose it with the simple quotecharacter ‘’’ to allow the implementation to follow the whole line to the MS call(otherwise only the last part will be sent to the MS call) : Additionally, argumentswith blank must be enclosed in double quote in Microsoft call (do not forget to espacedouble quote in VBA, with another double quote).for example CATIA.SystemService.ExecuteProcessus(”’””C:/Program Files/myApp/myApp.exe””’myArg1 ‘””myAr g2””’”)will start the command line “C:/Program Files/myApp/myApp.exe” myArg1 “myAr g2”on Microsoft OS. On Windows, to run a batch file you must execute the command interpreter: set the executable to cmd.exe set the arguments to the following ones: /c plus the name of the batch file. For example CATIA.SystemService.ExecuteProcessus“cmd.exe /c E:/MyBatchFile.bat” On Windows, an argument that contains a blank must bedoubly enclosed ; first with the single quote character then, inside the single enclosingquote, with the double quote character. For example CATIA.SystemService.ExecuteProcessus“cmd.exe /c ‘” & Chr$(34) & “E:/My Bat File.bat” & Chr$(34) & “’”Returns:The synchronous process return codeExample:This example executes the command located atwaits for it to end, and returns its return code.ReturnCode = CATIA.SystemService.ExecuteProcessus(“”)
- Parameters:
i_executable_path (str) –
- Returns:
int
- execute_script(i_library_name: str, i_type: int, i_program_name: str, i_function_name: str, i_parameters: list)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Func ExecuteScript(CATBSTR iLibraryName,CatScriptLibraryType iType,CATBSTR iProgramName,CATBSTR iFunctionName,CATSafeArrayVariant iParameters) As CATVariantExecutes a scripted function.Parameters:iLibraryNameThe library in which the script is containediLibraryTypeThe type of the libraryiProgramNameThe name of the program in the libraryiFunctionNameThe name of the function to invokeiParametersAn array of parameters for the functionoResultThe value returned by the function (if any)Example:This example executes the function CATMain in the program Macro1.catvbscontained by Part1.CATPartDim params()CATIA.SystemService.ExecuteScript”Part1.CATPart”,catScriptLibraryTypeDocument, “Macro1.catvbs”, “CATMain”,params
- Parameters:
i_library_name (str) –
i_type (int) – enum cat_script_library_type
i_program_name (str) –
i_function_name (str) –
i_parameters (tuple) –
- Returns:
None
- print(i_string)¶
Note
- CAA V5 Visual Basic Help (2020-06-09 09:53:18.676780))
- o Sub Print(CATBSTR iString)Prints a string on stdout.Parameters:iStringThe string to printExample:This example prints the string “Hello world!”.CATIA.SystemService.Print(“Hello world!”)
- Parameters:
i_string (str) –
- Returns:
None