CheckAndInsertBends Activity

Purpose: This activity checks if bends need to be inserted for sheet metal conversion and inserts them if necessary. Bends are essential features in Sheet Metal parts that define how the part can be folded and flattened for manufacturing.

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 bends were successfully inserted, false otherwise.

Type: bool

Note: Returns false if the bend insertion fails, if the document is invalid, if bends are not needed or cannot be inserted, or if an error occurs.

Usage Example

Scenario: Insert bends for a Sheet Metal part

Configuration:
- DocumentId: "doc-12345"

Result:
- Success: true (if bends were successfully inserted)
- Success: false (if bend insertion 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 bends cannot be inserted), 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 bend insertion succeeded. A false result may indicate that the part geometry does not require bends or that bends cannot be inserted for the current geometry.

Important Notes

  • The document must be open in SolidWorks and accessible via the DocumentId
  • This activity modifies the document by inserting bend features if needed
  • The part should be a Sheet Metal part - use CheckAndConvertToSheetMetal first if needed
  • Bends define how the Sheet Metal part can be folded and are essential for flattening operations
  • Not all Sheet Metal parts require bend insertion - the activity checks if bends are needed
  • The bend insertion process may modify the feature tree and add bend features
  • Consider saving the document after bend insertion to preserve the changes
  • Use this activity after CheckAndConvertToSheetMetal to complete the Sheet Metal conversion process

Related Activities