Hi
Please please can someone help or point me in the general direction (NOT API because infor isnt there). Im not asking for much, just a bit of help....
1. I need to be able to select multiple parts in an assembly by clicking them. The parts that are clicked need to stay highlighted so that i can process them in a routine. (i have tried the oSelect Class which is ok but cancels the selection after each clicked item
2. i need to be able to select ALL occurrences of a part in an assembly. If there are 7 occurrences of the same part, i need to select them and add them to a selectset.
In the assembly, i am looking the kLeafAssemblyOccurence which is what i need. i am also looking at doc.SelectSet.SelectMultiple (myObject)
i just cannot get it working and i fear a trip to the wig shop due to pull my own hair out lol.....
Please can anyone give me a general pointer or a bit of help?
Thanks
Nigel
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
1. Ok I will give you an example and point you to the api under the section Interacting with the User, and the sample Basic Selection Using Interaction Events API Sample.
Here's a sample in C# of the basic pattern I use for interactive selecting.
First set object filters/options and subscribe to the events on selecting and unselecting. Start the interactive selection session, Save/Remove objects as they are selected. The variable curSelection is true while I'm in selection mode. I have a button that sets that value to false and stops the selection process.
Or when I don't need it to be interactive, I use the Document.SelectSet object and have to workflow of the command be the objects must be preselected.
A select set doesn't need to be used to hold a collection of objects. Use an ObjectCollection. See TransientObjects.CreateObjectCollection().
2. Just loop through all the occurences in an assembly testing to see if they are the part you want and if so add them to a list or ObjectCollection.
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
Hi
Yes i am using vb.net
i'll update as i progress
thanks
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
Hi
most of it converted and i understand a lot of it however, i am erroring on parts. it looks like a button is created but i cannot see what function it calls.
pckAdd.btnDonePick.OnExecute += New ButtonDefinitionSink_OnExecuteEventHandler(btnDonePick_OnExecute) sle.OnSelect += New SelectEventsSink_OnSelectEventHandler(sle_OnSelect) sle.OnUnSelect += New SelectEventsSink_OnUnSelectEventHandler(sle_OnUnSelect)
Also, if i try and change these to Sub routines, i get errors
Private sub sle_OnUnSelect(ObjectsEnumerator Property SelectionDevice,() As UnSelectedEntities,SelectionDeviceEnum End Sub Private sle_OnSelect(ObjectsEnumerator Property SelectionDevice,() As JustSelectedEntities,SelectionDeviceEnum End Sub
Thanks
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
I have a button created else where that the command temporarily uses. It's a Done button the user can pick to signal when they are done selecting.
When the button is clicked it stops the interaction events, turns off the selecting flag, and calls the method that does the work passing the selected objects, and other clean up.
The two select event handlers should have the signature of
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
What does the signature of the function you're calling to do work on the parts look like? Ideally you would change it to accept the collection of parts you have picked. Instead of the SelectionSet you use the Collection of Parts.
What type of collection are you using?
Hi
Thanks for your reply. My function is a simple routine to split 1 part from another (where i place one into another). everything processed is a simple rectangle part (think plywood because thats what it is lol).
My intention is to select all of the parts that need to be split in a single process and once selected, run the routine to split the tool part. this is a single part that splits. the routine works fine with a single selection of part then tool but i cannot get the selected collection to do the same..
does that make sense lol?
Thanks
Nigel
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
Nacho
Automation & Design Engineer
Inventor Programmer (C#, VB.Net / iLogic)
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.
You need to have a collection to add/remove items to as they are selected in the Select events.
One way to do is like this.
Then pass the objCollection object to whatever function needs the collection.
Hi rjay75
Thank you so must for your code
I still have problem with
As you said, you will need a button to Done the Select Process. Can you share which code in that button