- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to change the flange-width of previously existing sheetmetal part using Inventor VBA code
I have a previously existing sheetmetal part with a flange (Flange1 - consider having only 1 flange). I need to get the "Flange1" feature and change the flange width with some other value.
Can you please help me with appropriate API for it? or a sample VBA code will do.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! This can be done quite easily using iLogic. Please share an example and forum experts can show the solution very quickly.
Many thanks!

Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I just have a simple problem that I have a sheetmetal part and a flange to it, as you can see in the image
for eg. I just need to change the flange width from 1 inches to 2 inches using simple VBA code.
I have tried various ways but I am unable to achieve the thing, so can anyone please help me with a simple code asap ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! This can be done in two ways (quite similar to manual process). You can edit the Flange and change the type (click on double-arrow button) to Edge or Width. Set the desirable distance accordingly.
For iLogic/API, you will need to alter the Flange type and change the parameters programmatically. Or, you change the Flange type before starting the rule. Then you only need to change the parameter values.
Many thanks!

Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Yes I know, but can i get just a simple VBA code to change the flangewidth ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
Don't know if the additional options are correct in your case.
Private Sub FlangeHeight()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oFeatures As SheetMetalFeatures
Set oFeatures = oPartDoc.ComponentDefinition.Features
Dim oFlange As FlangeFeature
Set oFlange = oFeatures.FlangeFeatures.Item(1)
Dim oFlangeDef As FlangeDefinition
Set oFlangeDef = oFlange.Definition
Call oFlange.SetEndOfPart(True)
Call oFlangeDef.SetDistanceHeightExtent("2 in", kPositiveExtentDirection, kHeightDatumOuter)
Call oPartDoc.ComponentDefinition.SetEndOfPartToTopOrBottom(False)
End Sub
R. Krieg
RKW Solutions
www.rkw-solutions.com