IsMultiBodyPart Activity
Purpose: This activity checks if the given SolidWorks document is a multi-body part. A multi-body part contains multiple solid bodies within a single part file, which is useful for complex designs or when working with multiple components in one part document.
Input Properties
The document ID returned by OpenSolidWorksFileActivity or GetActiveDoc. This should be the ID of an already-open SolidWorks document.
Type: string
Required: Yes
Example: "doc-12345"
Output Properties
True if the part contains multiple bodies, otherwise false.
Type: bool
Note: Returns false if the document is not a part, if it's a single-body part, or if an error occurs during the check.
Usage Example
Scenario: Check if a SolidWorks part contains multiple bodies Configuration: - DocumentId: "doc-12345" Result: - IsMultiBdyPart: true (if the part has multiple bodies) - IsMultiBdyPart: false (if the part has only one body or is not a part)
Error Handling
Important: The activity handles errors gracefully:
- If
InvalidOperationExceptionoccurs (e.g., document not found or invalid document type),IsMultiBdyPartwill be set tofalse - If any other exception occurs,
IsMultiBdyPartwill be set tofalse - The activity does not throw exceptions - it always returns a boolean result
Note: A false result may indicate either a single-body 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 works only with part documents - assemblies and drawings will return
false - Multi-body parts are useful for complex designs where multiple solid bodies exist in one part file
- Use this activity to determine if a part requires special handling for multi-body operations
- The activity does not register or capture document IDs - it only checks the existing document
Related Activities
- OpenSolidWorksFile - Open a SolidWorks file to get a DocumentId
- GetActiveDoc - Get the active document ID
- ExtractPartData - Extract detailed metadata from a part
- GetVolume - Get the volume of a part