Create Primitives from source

It is possible to create a Primitive from a source file. This is only useful if you have stars (primitive source code) created using Ptolemy or have written primitive source by hand.

These source code files are defined using the Ptolemy markup language and have the extension .pl. MLDesigner has a tool to convert source code files and include them in the MLDesigner standard libraries. If you have created your own Ptolemy stars and would like to incorporate them into MLDesigner, you need to save the .pl files to an $MLD_USER library, where you have read/write permission. These files will then be visible in the Tree View window of MLDesigner if you have checked the filter icon for primitive source files.

Right-click the relevant item indicated by the primitive name with the .pl extension and select Create Primitive to open the Create A New Model Component From Source dialog. The input fields Logical Name and Library can be entered. The Physical Name field is not editable. Click OK to convert the source files to MLDesigner primitives, the parser checks for name conflicts with MLDesigner standard libraries. If a built-in primitive with the same name already exists, you will not be allowed to convert the .pl file to a user defined built-in primitive unless you change the physical name and edit the appropriate reference to the filename in the source code.

To convert source code files with name conflicts to a MLDesigner type, proceed as follows: