CheckIfSheetMetal Activity
Purpose: This activity checks if the specified part or assembly contains Sheet Metal features. Sheet Metal parts have specific characteristics and require special handling for operations like flattening, bending, and exporting to DXF format.
Input Properties
The SolidWorks document ID. This should be the document ID returned by activities like OpenSolidWorksFile or GetActiveDoc.
Type: string
Required: Yes
Example: "doc-12345"
Output Properties
True if the document contains Sheet Metal features, otherwise false.
Type: bool
Note: Returns false if the document does not contain Sheet Metal features, if the document is invalid, or if an error occurs during the check.
Usage Example
Scenario: Check if a SolidWorks part is a Sheet Metal part Configuration: - DocumentId: "doc-12345" Result: - IsSheetMetal: true (if the part contains Sheet Metal features) - IsSheetMetal: false (if the part does not contain Sheet Metal features or if an error occurs)
Error Handling
Important: The activity handles errors gracefully:
- If
InvalidOperationExceptionoccurs (e.g., document not found or invalid document type),IsSheetMetalwill be set tofalse - If any other exception occurs,
IsSheetMetalwill be set tofalse - The activity does not throw exceptions - it always returns a boolean result
Note: A false result may indicate either a non-Sheet Metal part or an error condition. Ensure the document is valid and open before using this activity.
Important Notes
- The document must be open in SolidWorks and accessible via the DocumentId
- This activity checks for the presence of Sheet Metal features in the document
- Sheet Metal parts can be converted from regular parts using CheckAndConvertToSheetMetal activity
- Use this activity before performing Sheet Metal-specific operations like exporting to DXF
- The activity does not register or capture document IDs - it only checks the existing document
Related Activities
- CheckAndConvertToSheetMetal - Convert a part to Sheet Metal
- CheckAndInsertBends - Check and insert bends for sheet metal conversion
- ExportSheetMetalToDxf - Export a Sheet Metal part to DXF format
- OpenSolidWorksFile - Open a SolidWorks file to get a DocumentId