Automatically Unfold Sheet Metal Parts

Automatically Unfold Sheet Metal Parts

Raider_71
Collaborator Collaborator
1,218 Views
5 Replies
Message 1 of 6

Automatically Unfold Sheet Metal Parts

Raider_71
Collaborator
Collaborator

We have a batch routine that automatically unfolds sheet metal parts if there is no flat pattern found in the part. All the parts we process are sheet metal parts but if a designer forgot to create the flat pattern the batch routine will try and create it. 

We have noticed that this auto unfolding routine has become more unreliable than in the past version of Inventor. We use the standard API function "oSheetCompDef.Unfold()" to create the flat pattern definition in the part. Sometimes now with very simple plates it would fail. We have checked and the parts would be modelled correctly and thickness values set correctly as well.

Is there anything extra we can do to make this work a bit more reliably?

 

Thanks

0 Likes
1,219 Views
5 Replies
Replies (5)
Message 2 of 6

AlexFielder
Advisor
Advisor

If you're using built-in functionality that was reliable and is no longer, it could be that you've found a bug; do you have a set of files that worked in an older version of Inventor that you can test in your current version to see if there's any different outcome?

 

Failing that:

 

Do you have the latest service packs installed?

Do all the users create their sheet metal parts in exactly the same way (using resilient modelling techniques etc.)?

Are you able to share a file that worked, a file that didn't work and some small sample of the code you're running?

0 Likes
Message 3 of 6

k14348
Advocate
Advocate

Hi,

   Can't you use standard templates based on thickness? In such case if any of flatpattern missed we can do flat pattern using API.

 

-Karth

0 Likes
Message 4 of 6

Raider_71
Collaborator
Collaborator

Hi sorry I thought I replied already.

 

We have had intermittent failures when using the default unfold method on legitimate sheet metal parts which contain no flat pattern yet. It's not repeatable but we have noticed an increase in failures so its difficult to be able to build a case I can put forward with examples.

 

We are having great success with auto-unfolding using the unfold2 method which requires a face selection as input. 

So the process is basically:

- Check if the part has a flat pattern

- Select one of the faces of the sheet metal part - (We have developed a function for ensuring a valid face is selected)

- Execute the unfold2 method

 

This has been working great so far and we have not had any feedback to say that it does not.

 

Thanks anyways.

0 Likes
Message 5 of 6

k14348
Advocate
Advocate

Hi,

    Could you please send some sample ipt with your code?

Sub Flat_Pattern()

Dim openDoc As AssemblyDocument
Set openDoc = ThisApplication.ActiveDocument
Dim doc As Document
For Each doc In openDoc.AllReferencedDocuments
    If doc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
        Dim oDef As SheetMetalComponentDefinition
        Set oDef = doc.ComponentDefinition
        If oDef.HasFlatPattern = False Then
            oDef.Unfold
            oDef.FlatPattern.ExitEdit
            doc.Save
            doc.Close
        End If
    End If
Next

End Sub

 Sample code attached for your ref.

 

-Karth 

0 Likes
Message 6 of 6

Raider_71
Collaborator
Collaborator

Hi I do exactly the same as you but just with the unfold2 method

 

oDef.Unfold2(oFace as Face)

 

0 Likes