Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dxf flatpattern export with ini.file?

4 REPLIES 4
Reply
Message 1 of 5
noontz
2420 Views, 4 Replies

dxf flatpattern export with ini.file?

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!

4 REPLIES 4
Message 2 of 5
xiaodong_liang
in reply to: noontz

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.

 

 

Message 3 of 5
noontz
in reply to: xiaodong_liang

Thanks for your feedback Xiaodong..

 

I´ll give the latter a go!

Message 4 of 5
noontz
in reply to: xiaodong_liang

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
in reply to: noontz

Did you ever manage to solve this?

 

I am running against the same corrupt file issue

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report