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: 

Detecting the presence of bends

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
icouture
288 Views, 2 Replies

Detecting the presence of bends

I'm trying to write a little snipped of iLogic code to detect whether the sheetmetal part I am making has bends or not (we sometimes use the sheetmetal feature for flat plates with cutouts and such).

 

If a bend is detected, I would like one of my iProperties to change. Now I'm okay with that second part, but the bend detection has me stumped. I'm just not quite sure which API calls to make.

 

Any help is appreciated.

2 REPLIES 2
Message 2 of 3
LukeDavenport
in reply to: icouture

Hi icouture,

 

This should do it:

 

(It'll obviously error out if the current document is not a sheet metal part)

 

        Dim BendCount As Integer = ThisApplication.ActiveEditDocument.ComponentDefinition.Bends.Count
        MessageBox.Show(BendCount, "Title")


Message 3 of 3
icouture
in reply to: LukeDavenport

Thank you. That worked. The only problem is I get a random error once in a while that I have not been able to reproduce reliably. I will look further into this.

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

Post to forums  

Autodesk Design & Make Report