ilogic to handle mouse event for part selection

ilogic to handle mouse event for part selection

Anonymous
Not applicable
4,203 Views
4 Replies
Message 1 of 5

ilogic to handle mouse event for part selection

Anonymous
Not applicable

Hi, 

I would like to know, how to use ilogic to handle mouse event for selection of component in an assembly.

 

I need this code to change my process of selection as per the image below.

 

option for sequence1.png

 

I have attached the assembly file (Autodesk Inventor 2011).

 

Thanks in Advance

Regards,

Carthik Babu M.S

 

 

 

0 Likes
Accepted solutions (3)
4,204 Views
4 Replies
Replies (4)
Message 2 of 5

philippe.leefsma
Alumni
Alumni
Accepted solution

Hi Carthik,

 

iLogic is not suitable for advanced selection logic relying on events, if you need complex selection you have to use the Inventor API directly with Interaction Events. You can find complete examples in the API Help Files.

 

For basic selection in iLogic, you can use something like the code below:

 

Dim doc = ThisApplication.ActiveDocument

Dim entity = ThisApplication.CommandManager.Pick(
	SelectionFilterEnum.kAssemblyOccurrenceFilter, 
	"Select Component:")

If (Not entity Is Nothing) Then
	MsgBox(entity.Name)
End If

 

I hope it helps.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 5

Anonymous
Not applicable
Accepted solution

Hi,

Thank you a lot for this input. Modified my function based on your input and found the logic working.......

i have to learn these advance command.

Can you suggest me any good website to learn, how to handle Inventor. 

Below code is just to show, how i have modified my assembly. (Hope it will be useful for those, who search for this topic)

 

Function Remove_comp()
sel_flag=0
Dim entity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"Select Component:")
If (Not entity Is Nothing) Then
'MsgBox(entity.Name)
sel_flag=1
End If
If(sel_flag=1)
entity.Delete
End If
'zoom all
ThisApplication.ActiveView.Fit
End Function
0 Likes
Message 4 of 5

philippe.leefsma
Alumni
Alumni
Accepted solution

Those cmmands are the Inventor API itself. A good place to start learning it is to go through the API Help Files, part of the SDK in your Inventor install directory. The Help Files contain some overview topics and lots of sample code in VBA.

 

Other places you can check are the development blogs dedicated to Inventor:

 

http://adndevblog.typepad.com/manufacturing

 

http://modthemachine.typepad.com

 

http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=17324828

 

Regards,

Philippe.

 

 



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 5 of 5

Anonymous
Not applicable
Kindly check the below forum link for the 3d model and video of my updated assembly
http://forums.autodesk.com/t5/Autodesk-Inventor/ilogic-part-insertion/m-p/3921808#M470529
0 Likes