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

DocumentId

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

Success

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 InvalidOperationException occurs (e.g., document not found, invalid document type, or part cannot be converted), Success will be set to false
  • If any other exception occurs, Success will be set to false
  • 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