save as flat....(DXF) is producing an empty file
save as flat....(DXF) is producing an empty file
(OP)
Thanks to fellow member ailuJ and previous thread562-33964
I've tailored the following code to gain a DXF file, however the DXF file created is empty of any lines. I'm running the code as a vb exe within Solid Edge with the sheet metal part already open. Can anybody please help?
Public objApp As SolidEdgeFramework.Application
Set objApp = GetObject(, "SolidEdge.Application")
Dim objFoldedDoc As SolidEdgePart.SheetMetalDocument
Dim cActDocType As DocumentTypeConstants
cActDocType = objApp.ActiveDocumentType
If cActDocType = igSheetMetalDocument Then
Set objFoldedDoc = objApp.ActiveDocument
Else
Exit Sub
End If
objFoldedDoc.SaveAs "c:\test.dxf"
I've tailored the following code to gain a DXF file, however the DXF file created is empty of any lines. I'm running the code as a vb exe within Solid Edge with the sheet metal part already open. Can anybody please help?
Public objApp As SolidEdgeFramework.Application
Set objApp = GetObject(, "SolidEdge.Application")
Dim objFoldedDoc As SolidEdgePart.SheetMetalDocument
Dim cActDocType As DocumentTypeConstants
cActDocType = objApp.ActiveDocumentType
If cActDocType = igSheetMetalDocument Then
Set objFoldedDoc = objApp.ActiveDocument
Else
Exit Sub
End If
objFoldedDoc.SaveAs "c:\test.dxf"





RE: save as flat....(DXF) is producing an empty file
You can't save a sheet metal part as a DXF file. Check File/Save As you will see Save As Type doesn't provide dxf.
I guess you perhaps intended to save the Flat Pattern as DXF, which matches File/Save as Flat. If so, you would need to call function SaveAsFlatDXF, which is a member of SolidEdgePart.Models.
objFoldedDoc.Models.SaveFlatAsDXF(FileName As String, Face As Object, Edge As Object, Vertex As Object)
You will need to identify a planar face as the reference face, an edge which aligns to the x-axis in the flat pattern, and a vertex which matchs the original point in the flat patter.
I guess this function will work even with NULL edge and vertex.
RE: save as flat....(DXF) is producing an empty file
IMHO that will not work. Have a look into the sample
C:\Program Files\Solid Edge Vxx\Custom\GandT
(xx your SE version)
how to flatten a part. The GandT will flatten the part in the
x/y plane. And when you go this way you may use the
call objFlatDoc.Models.SaveAsFlatDxf(...)
to save the flattened part. But still then you are left with the
task to supply all the required arguments to the method ...
dy