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: 

Constrain-Flush(API/vba)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
444 Views, 2 Replies

Constrain-Flush(API/vba)

daniel_l8DM6N_1-1623863345824.png

 

I try to use constrain-flush those part. I don`t know how to dim the face in part from assembly file. I appreciate any help!

Labels (2)
2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: Anonymous

Maybe this can help you. This code takes the first face of the 1e and 2e occurrence and use them for a flush constraint. I think you can test this the best with an assembly that contains 2 cubes.

Dim doc As AssemblyDocument = ThisDoc.Document

Dim occ1 As ComponentOccurrence = doc.ComponentDefinition.Occurrences.Item(1)
Dim occ2 As ComponentOccurrence = doc.ComponentDefinition.Occurrences.Item(2)

Dim face1 As Face = occ1.SurfaceBodies.Item(1).Faces.Item(1)
Dim face2 As Face = occ2.SurfaceBodies.Item(1).Faces.Item(1)

Dim faceProxy1 As FaceProxy
Dim faceProxy2 As FaceProxy

occ1.CreateGeometryProxy(face1, faceProxy1)
occ2.CreateGeometryProxy(face2, faceProxy2)

doc.ComponentDefinition.Constraints.AddFlushConstraint(faceProxy1, faceProxy2, 0)

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3
Anonymous
in reply to: Anonymous

Thank you my friend!

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report