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: 

API - save as FLAT PATTERN

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
achmidt
864 Views, 2 Replies

API - save as FLAT PATTERN

Hello!

I was just wondering if anyone knows how to return to Folded part after creation of flat pattern using API code?

 

The code I have is straight forward, it saves dxf of the flat pattern if its exists, if flat pattern doesn`t exist it creates it and leaves the active ipt part as flat pattern on the screen.

 

    Private Sub SaveDXF()
        'Dim _inventorApplication As Inventor.Application
        ' get file name
        Dim pName As String
        pName = m_inventorApplication.ActiveDocument.DisplayName
        MsgBox(pName)
        ' Get the active document.  This assumes it is a part document.
        Dim oDoc As PartDocument
        oDoc = m_inventorApplication.ActiveDocument

        ' Save the current silent operation state.
        Dim silentState As Boolean
        silentState = m_inventorApplication.SilentOperation

        ' Get the DataIO object.
        Dim oDataIO As DataIO
        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&InvisibleLayers=IV_UNCONSUMEND_SKETCHES;IV_ALTREP_BACK;IV_ALTREP_FRONT;IV_ARC_CENTERS;IV_TOOL_CENTER_DOWN;IV_TOOL_CENTER;IV_TANGENT;IV_BEND;IV_BEND_DOWN"

        ' Create the DXF file.   
        oDataIO.WriteDataToFile(sOut, FolderPath & "\" & pName & ".dxf")
        oDoc.Update()


    End Sub

 

after running the code above

 

flatpattern.PNG

 

So my question is how to perform GOTO FOLDED PART command through API? So its shows folded part ?

 

Thank you!

Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen
2 REPLIES 2
Message 2 of 3
humbertogo
in reply to: achmidt

 with the FlatPattern.ExitEdit Method

 

something like

osheetMetalCompDef.Unfold() 'Go to flat pattern

 

osheetMetalCompDef.FlatPattern.ExitEdit() 'Go to folded part

Message 3 of 3
achmidt
in reply to: humbertogo

Thank you kind man!
Inventor Virtual Parts Addin

http://apps.exchange.autodesk.com/INVNTOR/en/Detail/Index?id=appstore.exchange.autodesk.com%3Avirtualpartsadd-in_windows32and64%3Aen

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

Post to forums  

Autodesk Design & Make Report