Code Generator

Code Generator Code Generator allows you to automatically generate and assign UserName, PartNumber and Description according to variables related to the model, so that the edit of the model even the Name, PartNumber and Description will be updated to the new value.

Youtube video - Code Generator

In the upper left there are four icons to load and save a configuration, set the current rules as defaults and remove any predefined settings, just below four text fields in which to write the data generation rules, while on the left the buttons with the label, which when pressed show a preview of the assigned value.

Code Generator

at the bottom of dialog box, there are two tabs:

Variables Tab, defines variables to be used to compose the User Name, PartName and Description.

Code Generator - Get From

  • Variable - name to be assigned variable
  • Get from - data from which to take the value
Variables Type:returns:option Name:
CustomData Valuevalue of the CustomDatathe name of the CustomData contained in the element
Material Namematerial name of the element
User Namename of the element
Sizebox Height of Elementtotal height of the element
Sizebox Length of Elementtotal length of the elementSM_Unfold returns the L dimension of the unfolded sheet metal
Sizebox Width of Elementtotal width of the elementSM_Unfold returns the W dimension of the unfolded sheet metal
Thickness of SheetMetalthickness value of sheet metal
Weight of Elementweight value of the elementtype of measurement Kg g lb oz
Weight of Element in Waterweight value of the element in watertype of measurement Kg g lb oz
Parameter Valueparameter valuename of the Parameter contained in the element
Volume of Elementvolume value of the element
Shell Featurethickness value of the shelled part
Thickness of IPROSteelthickness value of steels that have this property
Code of SheetMetalsheet metal code value
Part Numberpart number of the element
Descriptiondescription of the element
Sweep Path or Extrusion Section Lengthvalue of the length of the guide curve (3D curve or 2D sketch) of the sweep
3D Curve Lengthvalue of the length of the 3D curve
Document Propertiesfile property valuename of the Properties contained in the file
Element Surfacesurface value of all faces of the part
Global Position XX value of the absolute position
Global Position YY value of the absolute position
Global Position ZZ value of the absolute position
Longest Value of Sizeboxthe longest value (among L W H) of the sizebox
Number of Itemsnumber of linked elements (both internal and external)
Quantityquantity of the element
  • Name - the possible name of the data if available
    • ex. for Parameter Value, the name of the Parameter
    • ex. for weight you can choose the type of measurement Kg g lb oz
    • ex. for sizebox length and width, SM_Unfold returns the L and W dimension of the unfolded sheet metal part
  • Dec. - number of decimal to consider
  • Len. - length of the field (-1 undefined)
  • Fill Chr - fill with this character (if Len.> 1)
  • Value - value found by Get From

CustomData Tab, which defines the CustomData to add to the element and how to generate them.

  • Name - name to be assign to the CustomData
  • Expression - rule to define the value to be assigned to the CustomData
  • Value - value generated by rule and placed in the CustomData

Example of custom data get from expressions.

Code Generator CustomData

For edit the Code Generator, right clic on the part and select Open Codification dialog…

Example of construction of user name, part number and description.

Code Generator Anim