How to detect selected object type ?

 

I select object in SE assembly by creating command using Application.CreateCommand method. I using mouse settings:

 

Command.Mouse.WindowTypes = 1; //only graphic window   

Command.Mouse.EnabledDrag = false;

Command.Mouse.EnabledMove = true;

Command.Mouse.InterDocumentLocate = true;

Command.Mouse.LocateMode = (int)SolidEdgeConstants.seLocateModes.seLocateQuickPick;

Command.Mouse.ClearLocateFilter();

Command.Mouse.AddToLocateFilter((int)SolidEdgeConstants.seLocateFilterConstants.seLocatePart); //occurrence and suboccurrence objects, if i undestand it well

How to detect selected object type?

When i stop mouse moving above subassembly and wait, until appears icon QuickPick, then i click rigt mouse button and i select suboccurrence from list, this selected object is not occurrence nor suboccurrence.

How to detect type of selected object, and how to select suboccurrence in SE assembly? How to select subassembly occurrence ?

Thanks.

 

Posted by: Juraj Joob
Post date: 1/11/2010 10:28:06 AM

8 REPLIES

RE: How to detect selected object type ?

I have learned what object return QuickPick if i click on suboccurrence. It is Reference.

 

Posted by: Juraj Joob
Post date: 1/11/2010 7:15:19 PM

RE: How to detect selected object type ?

I have learned what object return QuickPick if i click on suboccurrence. It is Reference.

 

Posted by: Juraj Joob
Post date: 1/11/2010 7:15:21 PM

RE: How to detect selected object type ?

 

Hi Juraj,

 

you can check the type of the seleced objects in the SelectSet (you can select the objects with SelectSet.Add too) . All the items are the objects. If you select an occurrence (first level of a Topassembly) is a occurrence as type. If you select a suboccurrence with a mouse is a reference as type, the reference.object.type gives you the type (occurrence object, not suboccurrence object). If you select the object "occurrence" in subassembly, than is this an object of the subassembly and "not" from the Topasssembly. You should select a reference or a suboccurrence, and an occurrence only in first level of Topassembly.

 

Regards

JR

 

Posted by: JR
Post date: 1/11/2010 7:24:22 PM

RE: How to detect selected object type ?

Hi JR,

 

when i select suboccurrence with mouse, selected object pGraphicDispatch is SolidEdgeFramework.Reference object type. How to get SolidEdgeAssembly.Suboccurrence object from Reference object, because property Reference.Object give SolidEdgeAssembly.Occurrence object, not SolidEdgeAssembly.Suboccurrence object ?

 

Thanks.

 

Posted by: Juraj Joob
Post date: 1/11/2010 9:44:29 PM

RE: How to detect selected object type ?

Hi JR,

 

when i select suboccurrence with mouse, selected object pGraphicDispatch is SolidEdgeFramework.Reference object type. How to get SolidEdgeAssembly.Suboccurrence object from Reference object, because property Reference.Object give SolidEdgeAssembly.Occurrence object, not SolidEdgeAssembly.Suboccurrence object ?

 

Thanks.

 

Posted by: Juraj Joob
Post date: 1/11/2010 9:44:31 PM

RE: How to detect selected object type ?

Hi Juraj,

 

this is realy a Problem.

I go with loop from reference to top level and i save the names of the occurrences in an array. In next step i go from occurrence to suboccurrence with the name from the array as item. The names of occurrence and suboccurrence are the same.

I don't know a simpler way.

 

Posted by: JR
Post date: 1/11/2010 10:38:11 PM

RE: How to detect selected object type ?

Thanks JR, i try it.

 

Posted by: Juraj Joob
Post date: 1/11/2010 11:16:57 PM

RE: How to detect selected object type ?

I use this method in an assembly:

ASMobjDoc.SelectSet.Item(1).OccurrenceDocument

 

And this to know how much objects are selected:

ASMobjDoc.SelectSet.Count

 

Posted by: harry dijk
Post date: 2/5/2010 1:27:02 AM