cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the acutal selected object in an assembly (Block Styler: SelectObject)

Pioneer
Pioneer

Hi, 

 

i can get the selected object through 
TaggedObject[] taggedObjectVector = BlockProperties.GetTaggedObjectVector("SelectedObjects");

 

In case of a part file, this is OK, but what if the user selects a point from an assembly.

How to get the actual point if point is selected from an assembly.

 

Tried to get the parent part from selectedPoint.Prototype.OwningPart and find the point by searching by the Point Name. But point name returned by properties.GetTaggedObject differs in many cases.

 

Is there any way to find out the actual point object.

 

Regards,

Maddy

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4
2 REPLIES

Re: Getting the acutal selected object in an assembly (Block Styler: SelectObject)

Siemens Phenom Siemens Phenom
Siemens Phenom

 

Maddy,

 

If you perform selection in an assembly, it is likely that the thing you select will be the occurrence of the object in the assembly, rather than the original object in the component.

 

If your object is an occurrence - and you can determine this with IsOccurrence() - then you should just be able to ask for the Prototype.  Note that you should NOT need the OwningPart - just the selectedPoint.Prototype() should give you the original point.

 

Regards,

 

Steve

 

 

 

Re: Getting the acutal selected object in an assembly (Block Styler: SelectObject)

Pioneer
Pioneer

Thank you steve,

 

you just made my day, was trying the same since two days by going through the documentation

 

Regards,

Maddy

Windows 7 x64
NX 8.5, NX 9.0. And also NX 7.5
Visual Studio 2010 SP1, 2012 Update 4