InsertBomTable Activity
Purpose: This activity inserts a BOM (Bill of Materials) table into the specified SolidWorks assembly document using the specified BOM template. The BOM table is inserted into the active configuration of the document.
Input Properties
The SolidWorks document ID obtained from a prior GetActiveDocument activity. This identifies the assembly document where the BOM table should be inserted.
Type: string
Required: Yes
Example: "doc-12345"
Full path to the BOM template (.sldbomtbt) to use for insertion. The template defines the structure and formatting of the BOM table.
Type: string
Required: Yes
Example: "C:\Templates\MyBOMTemplate.sldbomtbt"
Note: The template file must exist and be a valid SolidWorks BOM template file.
Output Properties
JSON containing status and BOM metadata (if successfully inserted). Contains information about whether the BOM was inserted and its type.
Type: string
Note: If an error occurs, the JSON will contain an error object with "Inserted", "BomType", and "Message" properties. Currently, this activity returns a placeholder response indicating the functionality is not yet fully implemented.
Example (Success): {"Inserted": true, "BomType": "BomTableAnnotation"}
Example (Error): {"Inserted": false, "BomType": "Error", "Message": "Unexpected error: ..."}
Example (Not Implemented): {"Inserted": false, "BomType": "NotImplemented", "Message": "BOM insertion functionality is not yet implemented"}
Usage Example
Scenario: Insert a BOM table into an assembly document
Configuration:
- DocumentId: "doc-12345"
- TemplatePath: "C:\Templates\StandardBOM.sldbomtbt"
Result:
- BomInfoJson: {"Inserted": true, "BomType": "BomTableAnnotation"}
Error Handling
Important: The activity handles errors gracefully:
- If any exception occurs during insertion, BomInfoJson will contain an error object with
"Inserted": false,"BomType": "Error", and a"Message"describing the error - Currently, the activity returns a placeholder response indicating the functionality is not yet fully implemented
Always check the BomInfoJson output to verify the insertion status. Parse the JSON and check the "Inserted" property to ensure the BOM table was successfully inserted.
Important Notes
- The document must be a SolidWorks assembly document (not a part or drawing)
- The document must be open in SolidWorks and accessible via the DocumentId
- The BOM table is inserted into the active configuration of the document
- The BOM template file (.sldbomtbt) must exist and be accessible at the TemplatePath location
- The BOM table is inserted at position (0, 0) with indented BOM type and detailed numbering
- Note: This activity's implementation is currently incomplete - it returns a placeholder response indicating the functionality is not yet fully implemented
- Once fully implemented, the activity will insert the BOM table and return metadata about the inserted table
- This activity does not register or modify document structure beyond inserting the BOM table
Related Activities
- ExportBomToExcel - Insert BOM (if needed) and export to Excel in one step
- ExtractBomData - Extract data from an existing BOM table
- ValidateBomData - Validate the integrity of BOM data
- GetActiveDoc - Get the active SolidWorks document ID
- OpenSolidWorksFile - Open a SolidWorks file to get a DocumentId