Message 1 of 4
WriteDataToFile Problem

Not applicable
01-18-2008
09:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying this code on VBA, but it ONLY works if sketch is on XY plane, otherwise I got a bad DXF.
What kind of options does exist to DXF (on sOut)?
Public Sub WriteDXF()
' Get the active document. This assumes it is a part document.
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
' Get the DataIO object.
'Dim sFormats() As String
'Dim sStorageTypes() As StorageTypeEnum
Dim oDataIO As DataIO
Set oDataIO = oDoc.ComponentDefinition.Sketches.Item(1).DataIO
'oDataIO.GetOutputFormats sFormats, sStorageTypes
'MsgBox ("CompDef Output: " & ioPrint(sFormats, sStorageTypes))
' Build the string that defines the format of the DXF file.
Dim sOut As String
sOut = "DXF"
' Create the DXF file.
oDataIO.WriteDataToFile sOut, "c:\sketch.dxf"
End Sub
What kind of options does exist to DXF (on sOut)?
Public Sub WriteDXF()
' Get the active document. This assumes it is a part document.
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
' Get the DataIO object.
'Dim sFormats() As String
'Dim sStorageTypes() As StorageTypeEnum
Dim oDataIO As DataIO
Set oDataIO = oDoc.ComponentDefinition.Sketches.Item(1).DataIO
'oDataIO.GetOutputFormats sFormats, sStorageTypes
'MsgBox ("CompDef Output: " & ioPrint(sFormats, sStorageTypes))
' Build the string that defines the format of the DXF file.
Dim sOut As String
sOut = "DXF"
' Create the DXF file.
oDataIO.WriteDataToFile sOut, "c:\sketch.dxf"
End Sub