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

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

Hi,

 

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

 

Thanks

Anonymous
in reply to: fsdolphin

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

@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.

fsdolphin
in reply to: fsdolphin

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)