dxf flatpattern export with ini.file?

dxf flatpattern export with ini.file?

Anonymous
Not applicable
2,798 Views
4 Replies
Message 1 of 5

dxf flatpattern export with ini.file?

Anonymous
Not applicable

Hi.. Need some help on this, allthough it´s an oldiebutgoodie.

 

Digging throw tons of threads, blogs & help info, I´m still a bit confused, but believe I can boil my confusion down to these two basic questions:

  1. Do I NEED to use the DataIO to export the flatpattern to dxf, or is there some way I can pas a Flatpattern to the DXFAddIn.saveCopyAs()?
  2. How do I pas the .ini file to the DataIO.WriteDataToFile().  Do I need to write my own parser to get the Format correct?

Hope someone can clear this out for me!

0 Likes
2,799 Views
4 Replies
Replies (4)
Message 2 of 5

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

You could regard "DATAIO" as a lite level of DXF exporting, compared with TranslatorAddin. DATAIO does not use *.ini file. The configuration params are provided as the argument of DATAIO.WriteDataToFile. e.g.

 

Public Sub WriteSheetMetalDXF()

    ' Get the active document.  This assumes it is a part document.
    Dim oDoc As PartDocument
    Set oDoc = ThisApplication.ActiveDocument

    ' Get the DataIO object.
    Dim oDataIO As DataIO
    Set oDataIO = oDoc.ComponentDefinition.DataIO

    ' Build the string that defines the format of the DXF file.
    Dim sOut As String
    sOut = "FLAT PATTERN DXF?AcadVersion=R12&OuterProfileLayer=Outer"

    ' Create the DXF file.
    oDataIO.WriteDataToFile sOut, "C:\temp\flat2.dxf"
End Sub

 

 

If you activate flatpattern and run TranslatorAddin.SaveCopyAs, you will get the DXF from flatpattern.

 

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks for your feedback Xiaodong..

 

I´ll give the latter a go!

0 Likes
Message 4 of 5

Anonymous
Not applicable

Hi Xiaodong..

 

Coming back to this issue on a practical level I´m afraid there is a bit more to the picture than meets the eye.

 

Activating flatpattern & using SaveCopyAs() gives me a .dxf file allright, but the file is corrupted (not possible to open and the size is 19kb )??

 

Doing the same procedure manually generates a valid dxf file with a size of 215 kb

 

I am using the example from the help files to assign a path to the ini file, but checking the namedvaluemap of the dxf translator it contains no "Export_Acad_IniFile" key??

 

I see 4 members in the dxf translators namedvaluemap: Solid : true, Surface : true, Sketch : true, DwgVersion : 31.. ( Dwg ?? )

 

Exporting a flatpattern I would assume Solid & Surface should be set to false?? 

 

Is there an example with the correct assigning of the namedvaluemap that works for flatpattern & an ini file?

 

 

Message 5 of 5

Cadkunde.nl
Collaborator
Collaborator

Did you ever manage to solve this?

 

I am running against the same corrupt file issue

0 Likes