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: 

Isolate part: iLogic or VBA command?

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

Isolate part: iLogic or VBA command?

I'm programming a rule that searches an assembly for a certain criteria, selects the parts based on that, and I want to show only those selected parts. I can do this manually if I select the parts in the assembly tree, and then right click and choose "Isolate" however after searching through the forums and API Help, I can't seem to find any command that would allow me to do this, although I can do it manually. Is there a way to program this manual option, or am I just missing something?

 

The criteria I'm using is interference, and I want to see just the two parts that interfere. I've been collecting code and modifying it, and I'm so close. I'm able to recursively search through sub assemblies, and find the parts. I just need to only show the ones that I've selected through the code. I'll post the final code so anyone can use it afterwards.

2 REPLIES 2
Message 2 of 3
pball
in reply to: Anonymous

Well if you can select the parts you want programically I have a solution for isolating them. All commands in inventor are available while scripting, some just don't have a simple way to access them.

 

Attached is a text file of all the commands availble while scripting and shown below is a function to run those commands and the isolate and undo isolate examples. Hope this helps.

 

'isolate currently selected parts
run_cmd("AssemblyIsolateCmd")

'undo isolation
run_cmd("AssemblyIsolateundoCmd")

'function to run commands
Function Run_CMD(ByVal cmd As String) As Boolean
    ' Get the CommandManager object.
    Dim oCommandMgr As CommandManager
    Set oCommandMgr = ThisApplication.CommandManager

    ' Get control definition for the line command.
    Dim oControlDef As ControlDefinition
    Set oControlDef = oCommandMgr.ControlDefinitions.Item(cmd)
    ' Execute the command.
    Call oControlDef.Execute
End Function

 

Message 3 of 3
Anonymous
in reply to: pball

That worked. I now have two versions that I can share now. This is taken from the API Library as an example, but modified as an external rule for iLogic.

 

The attached rules are editable like Text, and can be run as an External Rule as is, or copied into a rule contained within a part or assembly.

 

I can't take much credit, as I just compiled the code, and converted it into iLogic. That being said, I can't confirm that it will work for everyone, but it works for all of my examples.

 

This basically works as a smarter Analyze Interference option.

  • You can either select one component, and see what else intersects with it.
  • You can select multiple components, and see what else intersect with them, but not each other. (Click Yes)
  • You can select multiple components, and see if they intersect with each other. (Click No)
  • You can select nothing, and see all the interference in the entire assembly.

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

Post to forums  

Autodesk Design & Make Report