list-checkRow 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.

circle-check
triangle-exclamation

Where to configure

To configure these rules:

  • Navigate to DataSources > Your Primary Cad Data Source

  • Click the Configure button

  • Navigate to the Configuration tab

  • There is a selection option for Generate sub-items using rules

  • Change 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.

circle-check
Supported Row Types
Supported

Generated Component Rows

Generated Material Children

Drawings

[future release]

Derivatives

not supported

Primary Source
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

Required Keyword
Description

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]

triangle-exclamation

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

triangle-exclamation
circle-check

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 value

  • Match condition . Single value

  • Search Text . Can be a list of values

Search Rule Parameters
Description

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.

Condition Text
Explanation

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.

Condition Text
Explanation

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

Condition Text
Explanation

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