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: 

How do I ask the user to select a part?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jpblower
302 Views, 1 Reply

How do I ask the user to select a part?

I want to have a code runs that has the user select which part or subassy is to be used for performing some other action.  Ie.  I want to create a new part out of 2 intersecting assy's.  I want the user to pick the base assy/part and the interference assy/part.  Then I'll use the code I've got to make the intersecting multibodied part.  I can make a gui that alters variables and runs code but don't have any idea how to select components.  Anybody know?

Tags (1)
1 REPLY 1
Message 2 of 2
pball
in reply to: jpblower

Dim oPart As ComponentOccurrence

Set oPart = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "Select the part to save and replace all.")
If (oPart Is Nothing) Then Exit Sub
Debug.Print oPart.Definition.Document.FullFileName

There is a quick example of prompting the user to select a file/assembly. Hope that helps.

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

Post to forums  

Autodesk Design & Make Report