Row Component Rules
We introduce here pre-BOM-load generation rules, or Row Component rules. These rules run:
After the BOM is generated in the Primary Datasource, but
Before the BOM is displayed on-screen. This is different to the client-side rules (Property Mapping Rules), which only run per-source, after the BOM is displayed on-screen.
You may think of row component rules as rules that affect the structure of a BOM. The structure of the BOM is affected by renaming components or adding new components. Compare this to Property Mapping rules that only affect the cell values, not the structure.
You should not attempt to rename existing components. Only the creation & updates of new components are supported.
Where to configure
To configure these rules:
Navigate to
DataSources> Your Primary Cad Data SourceClick the
ConfigurebuttonNavigate to the
ConfigurationtabThere is a selection option for
Generate sub-items using rulesChange this from
None⇒ Specify
When importing rows, you may want materials to automatically be listed as children of part components. The row component rules are meant to assist with this.
The current implementation focuses only on Material Rows generated. Future support is planned for non-material rows.
You may think of row component rules as rules that affect the structure of a BOM. The structure of the BOM is affected by renaming components or removing certain components
Generated Component Rows
✅
Generated Material Children
✅
Drawings
[future release]
Derivatives
not supported
Autodesk Inventor
[future release]
Autodesk Fusion
[future release]
CSV
[future release]
Onshape
✅
SolidWorks
[future release]
SolidWorks PDM
[future release]

New component rows (or material consumption rows) are rows that are generated for part documents that have a certain condition:
Each rule is run in the order specified
Rules are additive, so if the first rule causes the 2nd rule to match that will trigger a multi-rule run
Structure of a rule
The structure of a rule depends on keywords to manipulate the name. An template is provided below
Where the following keywords are used
order
The order in which a rule is executed
description
A user-friendly description of what the rule does. You may enter anything here
searchRule
What to search for. This can be a single or multiple criteria. See [1].
actions
The actions to perform when the searchRule is matched. If searching for say, PRT-123, and you find a match, the specified action will be performed. See [2]
Do not include the comments // in the rules. They're only for illustration purposes.
Example: Add a new material row if the component type equals "SM"
The following example, we check if a row's componentName starts with PN-1785. If it matches. It will automatically create a new row below it, setting the value of qty to 1 and naming the component PCX-1-PN-1785
Example: Substitute material name
In the example below, we'll search for any material call Aluminium. We'll change the value to AS-2005
Warning: To make troubleshooting easier, try not to run value substitutions for existing rows. In the example above, this will work, but you might run into difficulty trying to establish why the value in SharpSync is different to that of the value in your CAD system because there is no indication that the value has changed. Ideally you should use row component rules to create new rows only. But you know, we all have different needs, so if you find this is a requirement, go for it! ;)
The reason you might want to change values is because you have a legacy CAD library that has old values, and you want to still keep those in place, while updating the values displayed in SharpSync. This can still be achieved with Rules and you can see that it was edited with a rule. With Row Component Rules, you will not see that it was edited with a rule.
If you're unfamiliar with JSON editors, I've found the easiest editor for JSON is VSCODE
And now for the gory technical details
Technical Details
[1] Searching
When searching for a condition to be met, you have some options to play with for the searchRule parameter.
The way the searchRule works is that it takes 3 parameters. These are
Property name. Single valueMatch condition. Single valueSearch Text. Can be a list of values
1st Param
Property name: The property to search for. This is any property available in rowData.xxxx.
This includes values like rowData.isAssemblyRow, rowData.componentName, etc.
If the property is not prefixed with rowData. then the assumption is your searching in the row cells.
If you want to find a cell where the value of X is "Y", you would put
[ "X", "==", "Y" ]
If you want to find a cell where the value of material is "Steel", you would put [ "material", "==", "Steel" ]
If you want to find a component where the name of part is "PRT-1", you would put [ "rowData.componentName", "==", "PRT-1" ]
2nd Param
Match Condition : This is the condition that must be matched. The conditions available to you are listed in the conditions table below.
"contains" : a part of the value matches the specified string
"is" | "containsExact" : The value matches the complete string or numeric value you specified
"ends.
See the list of conditions below for all possible options
3rd Param
Search Text. The text used to identify a row. If the text is matched (or not matched based on the condition), an action is taken.
Search Conditions available in a rule (not case sensitive. Casing is applied below for ease of reading).
Some options have more than 1 way of being specified and is listed on different rows. They evaluate to the same result.
contains
The value your looking to match contains the text specified
is containsExact
The value your looking to match is exactly the text specified
endsWith
The value your looking to match ends with the text specified
endsWithExact
The value your looking to match ends with the text specified, including the casing of the text. So 'A' is not the same as 'a'
equals equal == =
The value your looking to match is equal to the value specified, ignoring the casing of the value specified. so 'Text' is equal to 'text'
equalsExact ===
The value your looking to match is equal to the value specified, considering the casing of the value specified. so 'Text' is not equal to 'text'
isInList in inList
The value your looking to match is in the list of values. If looking for Alu, you may search in the list [ "alu", "aluminium", "aluminum" ]
!=
Does not equal. Does not consider casing.
doesNotContain not notContain notContains
The value your looking to match does not contains the specified text, not taking into account the casing. Use this sparingly as this will match most rows.
notContainsExact
The value your looking to match does not contains the specified text, taking into account the casing. Use this sparingly as this will match most rows.
notExact notExactly <>
The value your looking to match does not equal the full specified text, taking into account the casing. Use this sparingly as this will match most rows.
regex
The value your looking to match may be found with the specified regular expression
startsWith
The value your looking to match starts with the specified text, ignoring the casing.
startsWithExact
The value your looking to match starts with the specified text, taking into account the casing.
[2] Row Actions
Row actions are actions that are performed on existing rows or new rows. There are 2 types of actions: RowCellAction and RowCreationAction
A RowCellAction performs an action on the cell specified for the row.
setValue setCellValue set
Sets the specified cell value or rowData.xxx value to the user specified value.
SharpSync considers this value as a source value from the CAD source. Has no noticeable effect on Property Mapping Rules.
copyValue copyCellValue copy
Only applicable to new rows. Sets the specified cell value or rowData.xxx value to the user specified value from the source row. This is the parent row values copied to the child row values.
SharpSync considers this value as a source value from the CAD source. Has no noticeable effect on Property Mapping Rules.
A RowCreationAction performs an action for an entire row
DoNothing
Default. Don't do anything. Ignore the row
CreateRow
Creates a new componentRow. The rowType is marked as a normal row. SharpSync considers this a source row from the CAD source. Has no noticeable effect on Property Mapping Rules.
CreateMaterialRow
Creates a new componentRow. The rowType is marked as isMaterialRow (true). SharpSync considers this a generated row which does not exist in the source CAD system. Can be used in Property Mapping Rules
ExcludeRow
Excludes the row from processing if the searchRule matches
Last updated