ExportSheetMetalToDxf Activity
Purpose: This activity exports a Sheet Metal part to DXF format. The DXF file is typically used for manufacturing processes like laser cutting, plasma cutting, or other CNC operations. The exported file contains the flattened sheet metal geometry.
Input Properties
Document ID of the open SolidWorks part. This should be the document ID returned by activities like OpenSolidWorksFile or GetActiveDoc.
Type: string
Required: Yes
Example: "doc-12345"
Root output directory for the DXF file. This is the folder where the DXF file will be saved.
Type: string
Required: Yes
Example: "C:\Exports\DXF" or "D:\Manufacturing\Exports"
Any specific DXF file name. By default, the activity will use the model name as the file name.
Type: string
Required: No
Example: "CustomName" or leave empty to use model name
Note: If not specified, the model name will be used as the DXF file name.
Output Properties
Full path of the exported DXF file, or null if export failed. If an error occurs, this will contain an error message string.
Type: string?
Note: Returns the full file path if export succeeds, or an error message (starting with "Error: " or "Unexpected error: ") if export fails.
Usage Example
Scenario: Export a Sheet Metal part to DXF format Configuration: - DocumentId: "doc-12345" - OutputRootPath: "C:\Exports\DXF" - DxfFileName: "" (empty, will use model name) Result: - DxfFilePath: "C:\Exports\DXF\PartName.dxf" (if export succeeds) Scenario: Export with custom file name Configuration: - DocumentId: "doc-12345" - OutputRootPath: "D:\Manufacturing\Exports" - DxfFileName: "CustomPartName" Result: - DxfFilePath: "D:\Manufacturing\Exports\CustomPartName.dxf" (if export succeeds)
Error Handling
Important: The activity handles errors gracefully:
- If
InvalidOperationExceptionoccurs (e.g., document not found, invalid document type, or Sheet Metal features not present),DxfFilePathwill contain:"Error: {exception message}" - If any other exception occurs,
DxfFilePathwill contain:"Unexpected error: {exception message}" - The activity does not throw exceptions - errors are returned in the
DxfFilePathoutput
Always check the DxfFilePath output to verify if the export succeeded. If the path starts with "Error: " or "Unexpected error: ", the export failed.
Important Notes
- The document must be open in SolidWorks and accessible via the DocumentId
- The part must be a Sheet Metal part - use CheckIfSheetMetal to verify before exporting
- The OutputRootPath directory must exist and be writable - the activity will not create directories
- If DxfFileName is empty or not provided, the model name will be used as the file name
- The exported DXF file contains the flattened sheet metal geometry suitable for manufacturing
- Ensure the output directory has sufficient disk space for the DXF file
- The activity does not register or capture document IDs - it only exports the existing document
Related Activities
- CheckIfSheetMetal - Check if a part is a Sheet Metal part
- CheckAndConvertToSheetMetal - Convert a part to Sheet Metal
- CheckAndInsertBends - Check and insert bends for sheet metal conversion
- OpenSolidWorksFile - Open a SolidWorks file to get a DocumentId