pycatia.dnb_igp_olp_ui.olp_translator¶
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-09-25 14:34:21.593357
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.dnb_igp_olp_ui.olp_translator.OLPTranslator(com_object)¶
Note
CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357)
System.IUnknownSystem.IDispatchSystem.CATBaseUnknownSystem.CATBaseDispatchSystem.AnyObjectOLPTranslatorRepresents the Offline Programming Translator object.Role: Interface dedicated to downloading or uploading robot or device tasks andformatting the output in the specified native robot language.This object can be retrieved by querying on a Robot. Forexample:Dim SelectionObject as SelectionDim RobotObject As ProductDim OLPTranslatorObject as OLPTranslatorSet SelectionObject = DELMIA.ActiveDocument.SelectionSet RobotObject = SelectionObject.Item2(1).ValueSet OLPTranslatorObject = RobotObject.GetTechnologicalObject(“OLPTranslator”)- convert_nrl_to_xml(i_nrl_file_name: str, i_parser_name: str, o_xml_file_name: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ConvertNRLToXML(CATBSTR iNRLFileName,CATBSTR iParserName,CATBSTR oXMLFileName)Converts NRL Program to OLP XML upload fileParameters:iNRLFileNameInput NRL Robot program file.iParserNamePath to Robot program parser.Legal values:Java parser packaged as JarA native parser packaged as an executableoXMLFileNameTarget XML output file
- Parameters:
i_nrl_file_name (str) –
i_parser_name (str) –
o_xml_file_name (str) –
- Return type:
None
- convert_xml_to_nrl(i_xml_file_name: str, i_xslt_file_name: str, o_nrl_target_folder: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub ConvertXMLToNRL(CATBSTR iXMLFileName,CATBSTR iXSLTFileName,CATBSTR oNRLTargetFolder)Converts OLP XML download file to NRL ProgramParameters:iXMLFileNameInput XML file.iXSLTFileNameTranslator file nameoNRLTargetFolderTarget folder where the robot programs will be saved. Name of theprogram files will be auto generated.
- Parameters:
i_xml_file_name (str) –
i_xslt_file_name (str) –
o_nrl_target_folder (str) –
- Return type:
None
- download_as_xml(i_robot_task: RobotTask, o_xml_file_name: str, i_is_part_coordinates: bool, i_is_simulated: bool, i_is_sub_routines: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub DownloadAsXML(RobotTask iRobotTask,CATBSTR oXMLFileName,boolean iIsPartCoordinates,boolean iIsSimulated,boolean iIsSubRoutines)Downloads a Robot task as XML fileParameters:iRobotTaskThe robot task to downloadoXMLFileNameName of XML file to be generatediIsPartCoordinatesif TRUE, the robot task will be downloaded in part coordinates ofiPart if FALSE, the robot task will be downloaded in robot base coordinatesiIsSimulatedif TRUE, Download will be simulation verifiediIsSubRoutinesif TRUE, XML will have tags marking call tasks for download assubroutines in main program file if FALSE, XML will have tags marking calltasks for download as separate files
- Parameters:
i_robot_task (RobotTask) –
o_xml_file_name (str) –
i_is_part_coordinates (bool) –
i_is_simulated (bool) –
i_is_sub_routines (bool) –
- Return type:
None
- download_tasks(l_list_of_tasks: tuple, s_path_to_xslt_translator: str, s_context: str, b_is_part_coordinates: bool, b_is_subroutine: bool, s_log_file_name: str) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub DownloadTasks(CATSafeArrayVariant lListOfTasks,CATBSTR sPathToXSLTTranslator,CATBSTR sContext,boolean bIsPartCoordinates,boolean bIsSubroutine,CATBSTR sLogFileName)Creates native robot language programs from V5 tasks. First the V5 RobotOffline Programming XML is generated for the given robot or device tasks innon-simulation mode. Then the XML file is supplied to the XSLT translator tocreate output in the corresponding native robot language.Role: Used to translate specified robot/device tasks to native robotlanguage program(s). It is responsibility of specified xslt translator toprovide the mechanism for saving its output to one or morefiles.Parameters:lListOfTasksList of robot or list of device tasks to downloadsPathToXSLTTranslatorAbsolute path to XSLT translator (downloader).If this is an emptystring, no XSLT translation will be done, and only OLP XML file will becreated.sContextValue that defines a context in which an XSLT translator works.This tells the translator how to format the output. Internally, the XSLTtranslator should have a mechanism in place on how to format its output basedon this value. This value is user defined and it may impact user developeddownloaders as well as RRS2 custom created downloaders. Any value of thisparameter, rather the supplied default value, will be assigned to the “Context”attribute of the “OLPData” XML element. Translators should check whether the“Context” attribute exists in the “OLPData” XML element, and if it does, theyshould redirect the XSLT output accordingly. If the attribute does not exist,which means that the translator has been invoked during execution of “CreateRobot Program” interactive command, then the translators should use OLP sectionmarkers in order to display their output in V5.Here are the section marker rules that need to be strictlyfollowed: It is important that the entire robot program output, designated tobe saved in a particular file, is enclosed between DATA FILE START and DATAFILE END markers. Translator output without any DATA FILE START and DATA FILEEND elements will be displayed in one tab page, generically named “Program.1”.If translator output has DATA FILE START and DATA FILE END elements (multiplepairs),but without , each enclosed section of the output will go into aseparate tab page named “Program.1”, “Program.2”,etc.Every downloader should use ERROR INFO START ERROR INFO ENDelements to store any error messages, in order to display them in theinformation text box of Download Editor.As with error messages, release and version information will becopied from the output’s VERSION INFO START VERSION INFO END markers and willbe displayed in the information text box of DownloadEditor.All of the marker elements need to start at the beginning of a newline and to end with a new line character. The examples arebelow:DATA FILE START myProgram.1 … DATA FILE ENDVERSION INFO START Delmia Corp. NachiAX Uploader Version 5 Release15. Copyright Delmia Corp. 1986-2003, All Rights Reserved. VERSION INFOENDERROR INFO START The error occurred during translation of Motion.1activity ERROR INFO ENDbIsPartCoordinatesFlag that signifies whether the download of the tasks should be inPart or Robot Base coordinates (important for a robot motion activity only).bIsSubroutineFlag that signifies whether a called Robot Task (important for calltask activities only) should be downloaded as a subroutine of a main robotprogram, or as a separate program contained in a separate file.sLogFileNameName of the log file that an XSLT translator can use to write datato. An empty string signifies that log file is not needed. It is important tonote that this is just a file name, not an absolute path to that file. This logfile is supposed to be saved to a directory which is a descendant of adownloader root directory. Downloader root directory is defined in the XMLthrough the “DownloaderRootDirectory” attribute of the “OLPData” XMLelement.
- Parameters:
l_list_of_tasks (tuple) –
s_path_to_xslt_translator (str) –
s_context (str) –
b_is_part_coordinates (bool) –
b_is_subroutine (bool) –
s_log_file_name (str) –
- Return type:
None
- get_robot_program_directory() str ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetRobotProgramDirectory() As CATBSTRRetrieves the OLP Directory setting parameter value.Role: The OLP Directory setting parameter stores the full file path todirectory where native robot language programs will bestored.Returns:The OLP Directory setting parameter value
- Return type:
str
- get_xml_file_directory() str ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Func GetXMLFileDirectory() As CATBSTRRetrieves the XML Directory setting parameter value.Role: The XML Directory setting parameter stores the full file path todirectory where OLP XML file created on download is stored. By default, OLP XMLfile name is simResult.xml.Returns:The XML Directory setting parameter value
- Return type:
str
- upload_from_xml(i_robot_task: RobotTask, i_xml_file_name: str, i_is_part_coordinates: bool, i_part: Product) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub UploadFromXML(RobotTask iRobotTask,CATBSTR iXMLFileName,boolean iIsPartCoordinates,Product iPart)Upload a Robot task from XML fileParameters:iRobotTaskRobot task to uploadiXMLFileNameName of source XML fileiIsPartCoordinatesif TRUE, Robot task will be uploaded in part coordinates of iPartif FALSE, Robot task will be uploaded in robot base coordinatesiPartPart in whose coordinates the program will beuploaded
- upload_robot_program(sp_i_selected_robot: Product, s_path_to_robot_program_file: str, s_path_to_uploader_file: str, b_is_upload_in_part_coords: bool) None ¶
Note
- CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
- o Sub UploadRobotProgram(Product spISelectedRobot,CATBSTR sPathToRobotProgramFile,CATBSTR sPathToUploaderFile,boolean bIsUploadInPartCoords)Creates robot or device tasks in V5 based from native robot languageprogram file or an OLP XML file.Role: To be used to create specified robot/device tasks from native robotlanguage program file(s) or from OLP XML file.Parameters:spISelectedRobotRobot or Move-By-Joint Device, which will own all the uploadedrobot or device taskssPathToRobotProgramFileAbsolute path to a native robot language (NRL) program file or anabsolute path to OLP XML file to be uploadedsPathToUploaderFileAbsolute path to OLP uploader file. If this is specified as anempty string, the previous parameter must point to an OLP XML file. If thisstring is not empty, the previous parameter must point to an NRL program file.bIsUploadInPartCoordsFlag that signifies whether the upload of robot programs(s) or XMLfile should be in Part or Robot Base coordinates (important for robot motionactivities only).
- Parameters:
sp_i_selected_robot (Product) –
s_path_to_robot_program_file (str) –
s_path_to_uploader_file (str) –
b_is_upload_in_part_coords (bool) –
- Return type:
None