MacroSolid - Properties
PROPERTIES macro - allows you to define, delete and replace both custom and configuration-specific properties in bulk.
In addition to supporting standard capabilities, i.e. entering SOLIDWORKS® formulas (e.g. $PRP:"SW-File Name") and / or values from predefined selection lists, this macro has been equipped with a number of functions that automate assigning properties that you will not find anywhere else. This includes: Qty., To the left/right of File name, To the left/right of Folder name, Numbers, Copy from cut lists, Copy from material, Folder name, My Parent, Active Document, MyID, From File name.
The property assignment can be based on whether the component is a part, assembly, sheet metal, or welded construction.
The macro window settings can be saved each time under any name, thanks to which a selection of presets is built filled with variants of property settings, which can be invoked in specific situations.
Material, Weight, Name, Description, Number, Number of pieces are data that you will use in material lists, link notes and annotations in 2D drawings and 3D models. If you save additional properties to the file, such as Type, Type of processing, Dimensions, Color, Manufacturer of the commercial part, you will improve communication with technologists, the procurement department and your cooperators. You will use the defined properties to filter components of the FeautureManager tree, in assembly visualization and as global variables in equations.
The Properties macro supports standard properties, "Custom Properties" and "Configuration Specific" properties.
Author, Title, Subject, Comments, Keywords are standard file properties that every file in WINDOWS has. You can add, modify, view them in the "Summary" tab in the "Properties" window, but also from the Windows file explorer. You can complete these properties in SOLIDWORKS® only for the active document. Other information such as: Date of creation, modification, who last saved the file are read-only. The Properties macro provides bulk definition of, among others, these standard file properties, but remember to use the appropriate, predetermined "Property Name":
- Author -> [SW-Author],
- Title -> [SW-Title],
- Subject -> [SW-Subject],
- Comment -> [SW-Comment] and
- Keywords -> [SW-Keywords].
In "Custom Properties" you can save additional information about the model. If modeling in configurations is allowed in your company, i.e., creating different versions, e.g., of dimensional configurations, due to material, appearance, then properties that may take different values from this point of view should be defined in "Configuration-specific".
You can configure the Properties macro according to your needs. The most important thing is to specify the name and choose the method of assigning the value.
You have functions at your disposal, quick date selection, lists that you can prepare in advance, options for retrieving information from cut elements .... the ability to download information from the material assigned to the model. You can also enter your text directly. These functions are systematically developed and extended at the request of Users.
- File name function - a function that automatically enters the file name into the property.
- Weight function - a function that automatically enters the mass into the property using the "SW-Mass" formula.
- Material function - a function that automatically enters the assigned material into the property using the "SW-Material" formula.
- Qty. function – a function that recalculates and enters the number of occurrences in the active document, with which the Properties macro worked, into the component properties.
- Folder name function – a function that enters the name of the folder (not the path) on the computer drive where the given file/component is located in the component properties.
- To the left/right of File name function – a function that writes to the property a fragment of text (filename) to the left of the underscore "_" and to the right. After unchecking the "Default from _" option, you can precisely specify how many characters should be taken from the left side in the case of the "left from" function and from which character the text from the file name should be taken in the case of "right from".
- To the left/right of Folder name function – a function that writes to the property a fragment of text to the left of the underline "_" and to the right. The function analyzes the name of the folder on the computer disk in which the considered file or component is located.
- Numbers function – component numbering function according to the adopted scheme. Numbering can be done in two ways, including sub-assemblies or not.
- My Parent function – function that allows you to enter the name of the assembly in which it is located in the component properties. With enabled option `With function To the left/right of File name` allows you to save the name of the assembly with the simultaneous function of cutting the text "right of" to "left of" described above.
- Active Document function - function that allows you to enter the name of the main assembly in which it is located in the property.
- LogUserName function - name of the User logged in to the WINDOWS system.
- Date.Today function – function that allows you to enter the current date into the properties.
- MyID function - function that allows assigning in the properties subsequent entries defined in the "MyID" list to appropriate, subsequent components in the assembly.
- SUM(Prop1, Prop2) function - function that allows entering into the property the result of summing two properties selected by the user, which are real numbers, which extends the existing functionality of SOLIDWORKS®, which so far only provided the possibility of summing text values.
- From File name function - a function that allows you to enter the text defined in the "FromFileName" list into the property, if the given text is in the file name. For example, if abbreviations are used in the file name, e.g.
SM - Sheets,
TP – Turned parts,
MP - Milled parts,
WJ - Water Jet -Gaskets, O-rings, plastics, blanks - cut with water,
PR - Profile - Pipes and profiles,
RD – Rods,
SL - SLS - Selective laser sintering - laser sintering and 3D printing,
GM - Rubber elements, but not water-cut,
SP –Springs,
GL – Glass,
EL – Electrics,
CA – Castings
then the above-mentioned designation will be added to the property. - MyText function- function that allows you to insert any text into the property. Above mentioned text user enters directly into the "Value" control and it is saved in the "MyText" list. By default, the list has been supplemented with useful SOLIDWORKS® formulas, i.e.:
"SW-SurfaceArea"
"SW-Volume"
"SW-Mass"
"SW-Material"
$PRP:"SW-Last Saved By"
$PRP:"SW-Author"
$PRP:"SW-Long Date"
$PRP:"SW-Short Date"
$PRP:"SW-Last Saved Date"
$PRP:"SW-Created Date"
$PRP:"SW-Configuration Name"
$PRP:"SW-Folder Name"$PRP:"SW-File Name".SLDASM
$PRP:"SW-Folder Name"$PRP:"SW-File Name".SLDPRT
$PRP:"SW-Folder Name"
$PRP:"SW-File Name"
SMP $PRP:"Material" #$PRP:"Thickness"
SM $PRP:"Length" x $PRP:"Width" x $PRP:"Thickness"inch
SM $PRP:"Length" x $PRP:"Width" x $PRP:"Thickness"mm
$PRP:"Name" - $PRP:"Length"mm - Copy from cut lists - a function that allows you to copy the selected property from the cut element to the file property. The function works with the design assumption "one file" = "one cut". You can copy sheet cut part properties and weldment cut part properties to the file properties.
- Copy from material - a function that allows you to copy the custom property value of the material assigned to the model to the file properties.
- Delete - feature to delete properties.
You can prepare a few of your settings and save them under any name (1) and then call them without starting the window, from above, from the CommandManager (2) or from the BOM tab (3).
If you run the macro at the level of the window (4), then all files related to this model will be "reworked" in the assembly (5) or only files at the highest level of the assembly structure (6), excluding those that "caught" Skip options. You can skip by name (7), i.e., if the program finds defined phrases in the file name, e.g., DIN, ISO, etc. You can skip files in a folder, FeatureManager tree - this particular one (8) or in any (9). You also have the option of skipping files located in a specific location (10) - the program analyzes the path to the file and on this basis determines whether to skip or not. Skip options are not respected in the BOM tab mode, because there you have full control over the functionality of the macro.
QuickProperties is a Properties macro that can be quickly configured from the BOM tab (1), but limited to seven properties. QuickProperties can be set (2) and run on the entire BOM table (3) or on selected rows (4).
In the QuickProperties interface, the ability to switch between twenty settings (5) has been added, which you can configure in more detail in the Properties macro window.
QuickProperties is also the ability to directly enter property values from the BOM table (6), after double-clicking the left mouse button on the cell.
Copyright © ADKSolid. All rights reserved