CustomProperty Functions

Use functions on CustomProperty to store various kind of dynamic data into property.

Info NOTE: The only available function for a the Version Properties is the GetCurrentDate function available as a Before Function.

Functions for the CustomProperty:

The CustomProperty funtions are separated to the following groups based on the function type.

Before function The function is performed automatically when the CustomProperty pane is opened.
After function The action defined in the after function is performed after a CustomProperty value has been defined.
Button function Defines the function of the button that will be used with the CustomProperty.
Data Function Defines the function of the dynamic data stored into a CustomProperty. Data function handles the data in relation with the data of CustomProperty.
Data Function Usage Examples


The following functions are available in the groups mentioned above:

Before Functions:

  Property Scopes Property Types
Function name Description Model Part Assembly Drawing Version Cut-List Combobox Editable Combobox Editbox Date
GetCurrentDate Insert the current date into the custom property.      
GetCombinations Retrieves the available combinations into the combobox property.      
GetMaterials Inserts the SOLIDWORKS materials into the combobox list.            
GetMass Gets the total weight of the assembly components to the property.            
GetUserInitials Gets the initials of the CustomTools database user that is currently logged in.    


After Functions:

  Property Scopes Property Types
Function name Description Model Part Assembly Drawing Version Cut-List Combobox Editable Combobox Editbox Date
SetColor Sets the color for the part. The current color of the part is overwritten by the selected color.          
SetDensity Sets the density based on the selected material.                


Button Functions:

  Property Scopes Property Types
Function name Description Model Part Assembly Drawing Version Cut-List Combobox Editable Combobox Editbox Date
GetCode Generates a document code based on your own sequences. The btnIcon button associated to the property opens the New Code dialog box.        
GetColor Selects a color from your list of customized color.          
GetDatabaseItem Search the desired value an external data source and establish a link between the CustomProperty and the desired value retrieved from the external data source.      
GetRALColor Selects a color from your list of RAL color. The btnIcon button associated to the property opens the Custom Colors dialog box used to select the desired RAL color.          
OpenDictionary Opens the dictionary based on the default language selected in the general user options.        
Revisions Opens the component's revision table. The btnIcon button associated to the property opens the Revisions dialog box used to fill in the revision data of the selected component.        
SetEntityData Store the desired data for the Custom Entity Property.          

Info NOTE: The CustomEntity Properties are not shown in the SOLIDWORKS document properties but the entity properties can be used to search documents from the CustomTools database. The value you set to the CustomEntity does not appear into the CustomProperty related editbox either but the CustomProperty gets dirty to indicate that the value is stored into the database.

Info NOTE:The GetDatabaseItem button function is available for the Editable combobox properties only on the CustomProperties that scope is Part.


Data Functions:

  Property Scopes Property Types
Function name Description Model Part Assembly Drawing Version Cut-List Combobox Editable Combobox Editbox Date
GetCombinationValue Get value to the CustomProperty from the combination selected in the Combination box.      
GetListKeyValue Get the key value selected in the Value from box from the Lookup list based CustomProperty selected in the Source property box.      
GetParentItem Get value from the parent document's CustomProperty selected in the Source Property box.          
GetTranslation Get translation of a dictionary based multilingual CustomProperty selected in the Source Property box in a language selected in the Target language box. Source properties available in the Source property box have the OpenDictionary selected as the Button function.      


Additional options for the functions:

Dictionary Use the Dictionary box to determine a dictionary used by the CustomProperty which have OpenDictionary selected as the Button function.
Target language Select the target language to translate the custom property selected in the Source property box of a CustomProperty which have GetTranslation selected as the Data function.
Source property Select the CustomProperty used as the source of the value linked to another property.
Combination Use the Combination box to determine combination used to retrieve the value to a custom property which have GetCombinationValue selected as the Data function.


Data Function Usage Examples:

GetParentItem

The GetParentItem data function's idea is to allow the user to get the desired CustomProperty value from the model it is a part of.

For Example: Let's say we have a CustomProperty labelled as Used On. The property is scoped to the Model documents and the property also have the GetParentItem data function in use in association with a model property called Drawing No which is used to write the model document's code into.

Then, we have a part called 000030.sldprt which belongs to an assembly called 000026.sldasm like shown in the following picture. In this case the Used On property in component 000030.sldprt gets value 000026 based on value in its parent document's (000026.sldasm) property called Drawing No.

Pic_GetParentItem




Multilingual custom properties:

Use GetTranslation as the Data function to retrieve translation in the language selected in the Target language box based on the dictionary based property selected in the Source property box.

Use the Target language box to select language to retrieve the source property's value in.

The Source property box is used to select the dictionary based CustomProperty to be translated into target language selected in the Target language box.



Usage with combined properties:

The Source property sets the desired combined property as a source of value for the custom property. The GetCombinationValue must be selected from the Data function.



Insert CustomProperties to the BOM of the SOLIDWORKS drawing:

You can insert CustomProperties as new columns into the BOM (Bill of Materials) of the SOLIDWORKS drawing created from the model document. Please see the SOLIDWORKS help about the Bill of materials for the further information.



General Controls:

The general controls are included in all pages of the CustomProperty Wizard.

Back Return to the previous page of the CustomProperty Wizard.
Next Proceed to the next page of the CustomProperty Wizard.
Finish Save the property and close the CustomProperty Wizard.




Related Topics

Defining the Basic Information
Database Options
Hidden Properties
Required CustomProperties

Back to Top