CheckAndConvertToSheetMetal Activity
Purpose: This activity checks if a part can be converted to Sheet Metal and performs the conversion if possible. Sheet Metal conversion is necessary for parts that need to be flattened, bent, or exported to DXF format for manufacturing processes.
Input Properties
ID of an open SolidWorks document. 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 part was successfully converted to sheet metal, false otherwise.
Type: bool
Note: Returns false if the conversion fails, if the document is invalid, if the part cannot be converted, or if an error occurs.
Usage Example
Scenario: Convert a regular part to Sheet Metal Configuration: - DocumentId: "doc-12345" Result: - Success: true (if the part was successfully converted to Sheet Metal) - Success: false (if the conversion failed or if an error occurred)
Error Handling
Important: The activity handles errors gracefully:
- If
InvalidOperationExceptionoccurs (e.g., document not found, invalid document type, or part cannot be converted),Successwill be set tofalse - If any other exception occurs,
Successwill be set tofalse - The activity does not throw exceptions - it always returns a boolean result
Always check the Success output to verify if the conversion succeeded. A false result may indicate that the part geometry is not suitable for Sheet Metal conversion.
Important Notes
- The document must be open in SolidWorks and accessible via the DocumentId
- This activity modifies the document by converting it to Sheet Metal format
- Not all parts can be converted to Sheet Metal - the part geometry must be suitable for Sheet Metal operations
- After successful conversion, use CheckAndInsertBends to add bend features if needed
- Use CheckIfSheetMetal to verify if a part is already a Sheet Metal part before attempting conversion
- The conversion process may modify the feature tree and add Sheet Metal-specific features
- Consider saving the document after conversion to preserve the changes
Related Activities
- CheckIfSheetMetal - Check if a part is a Sheet Metal part
- CheckAndInsertBends - Check and insert bends for sheet metal conversion
- ExportSheetMetalToDxf - Export a Sheet Metal part to DXF format
- Save - Save the document after conversion