Sunday, February 05, 2012
How to detect selected object type ?
Last Post 05 Feb 2010 07:27 AM by harry. 8 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
11 Jan 2010 04:28 PM  

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.

Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
12 Jan 2010 01:15 AM  
I have learned what object return QuickPick if i click on suboccurrence. It is Reference.
Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
12 Jan 2010 01:15 AM  
I have learned what object return QuickPick if i click on suboccurrence. It is Reference.
JRUser is Offline
New Member
New Member
Posts:91

--
12 Jan 2010 01:24 AM  

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

Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
12 Jan 2010 03:44 AM  
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.
Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
12 Jan 2010 03:44 AM  
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.
JRUser is Offline
New Member
New Member
Posts:91

--
12 Jan 2010 04:38 AM  
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.
Juraj JoobUser is Offline
New Member
New Member
Posts:26

--
12 Jan 2010 05:16 AM  
Thanks JR, i try it.
harryUser is Offline
New Member
New Member
Posts:7

--
05 Feb 2010 07:27 AM  
I use this method in an assembly:
ASMobjDoc.SelectSet.Item(1).OccurrenceDocument

And this to know how much objects are selected:
ASMobjDoc.SelectSet.Count
You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET