Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

How to show the number of bends in a sheet metal part

fsdolphin
Collaborator

How to show the number of bends in a sheet metal part

fsdolphin
Collaborator
Collaborator

Hi,

 

Is it possible to show the number of bends in a sheet metal part using iLogic?

 

Thanks

0 Likes
Reply
Accepted solutions (1)
694 Views
3 Replies
Replies (3)

Anonymous
Not applicable
Accepted solution
Hey there fsdolphin,
 
 
 
This was quick and dirty but it should get you what you need.  I didn't fully test it so there is a slight chance there may be some features it doesn't recognize but I did test with normal flanges and contour flanges.  I would think this is where the bend id's come from for tagging in a drawing so I think we're pretty safe.

 

 

SyntaxEditor Code Snippet

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oCompDef As SheetMetalComponentDefinition
oCompDef = oPartDoc.ComponentDefinitions.Item(1)

oBendCount = oCompDef.Bends.Count

MsgBox("Bend Total: " & oBendCount)

 

Thanks,

Randy

fsdolphin
Collaborator
Collaborator

@Anonymous

 

Cool, that worked.

 

One more question, I know I know but I'm currently learning how to find information in the Inventor APIs.

 

Is it possible to identify howmany bends are 90° and howmany are other than 90°?

 

Thanks a lot.

0 Likes

fsdolphin
Collaborator
Collaborator

I found the BendRadius property in the API but I don't know how to use it.

Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument

Dim oCompDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinitions.Item(1)
Dim oBendCount As String = oCompDef.Bends.Count

Dim oBendRadius As Parameter = oCompDef.BendRadius

MessageBox.Show("Bend Total: " & oBendCount)

MessageBox.Show(oBendRadius)
0 Likes