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: 

Add flange to part in assembly

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
askokk
433 Views, 2 Replies

Add flange to part in assembly

Hello.

 

Im just getting started with API and would like you to show me some guidelines.

For my first project Im trying to following:

 

Assembly document is open. In this assembly there is a sheet metal part called "BAR"

 

Now what i want to do is select one of sheet metal part edges using pick function and add a flange to that edge.

Something like this was able to do that in in part environment:

Public Sub addflange()

Dim oSheetMetalDoc As PartDocument
Set oSheetMetalDoc = ThisApplication.ActiveDocument

Dim oCompDef As SheetMetalComponentDefinition
Set oCompDef = oSheetMetalDoc.ComponentDefinition

Dim oSheetMetalFeatures  As SheetMetalFeatures
Set oSheetMetalFeatures = oCompDef.Features


'Pick edge
Dim oEdge As Object
Set oEdge = ThisApplication.CommandManager.Pick(kPartEdgeFilter, "edge")

'Add edge to edges collection
Dim oEdgeC As EdgeCollection
Set oEdgeC = ThisApplication.TransientObjects.CreateEdgeCollection
Call oEdgeC.Add(oEdge)

'Create flange definiton
Dim oFlangeDef As FlangeDefinition
Set oFlangeDef = oSheetMetalFeatures.FlangeFeatures.CreateFlangeDefinition(oEdgeC, "45 deg", 20)

'Add flange
Dim oFlangeFeature As FlangeFeature
Set oFlangeFeature = oSheetMetalFeatures.FlangeFeatures.Add(oFlangeDef)

End Sub

But I need it to be done in ASSEMBLY environment. 

So that the active document  would be assembly document, select PART edge from ASSEMBLY document  (i think this is where i get lost) and then add flange to this sheet metal part file.

 

Am I on heading to the right direction?

Any suggestions?

 

 

 

2 REPLIES 2
Message 2 of 3
askokk
in reply to: askokk

Been looking around a little.. are "Face Proxies" something I have to create here?

Message 3 of 3
askokk
in reply to: askokk

Got it working.

It turns out that "Edge proxies" are allready there.. no need to create one:D

I just had to use EdgeProxy.NativeObject instead of just Edge.

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

Post to forums  

Autodesk Design & Make Report