Auto Unfold

Have you ever gone to place a drawing view of some sheet metal and the flat pattern option is greyed out?

This little ditty I composed slips straight in your iLogic rule and simply unfolds the part and folds it back up again, creating a flat pattern in the process. 

Stick it on a trigger just before save in your template file and never have to worry about this happening again!






Dim oDoc As PartDocument
oDoc = ThisDoc.Document
Dim State As SheetMetalComponentDefinition
State=oDoc.ComponentDefinition
If State.HasFlatPattern = False Then
State.Unfold 
ThisDoc.Document.ComponentDefinition.FlatPattern.ExitEdit
End If

Comments

  1. Hello!
    What about unfolding every single part in assembly. Let's say I have an assembly with 10 sheet metal parts in it. And I would like each one unfolded with one click iLogic. Do you have any iLogic code for that?

    ReplyDelete
    Replies
    1. You can do this, you just need to set up a loop that goes through every leaf component, checks if it's a sheet metal part, open it in the background, unfold and save and then close.

      Delete
    2. Hey thank you for that. Do you maybe know the code for this ?

      Delete
    3. No sorry, there's this that might help:
      https://forums.autodesk.com/t5/inventor-programming-ilogic/loop-on-all-parts-and-then-after-its-occurrences/td-p/10574794

      Delete

Post a Comment

Popular posts from this blog

Pushing Parameters to all parts

Style Library Conflicts