Cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Rectangle Position Points using BlockStyler

Pioneer
Pioneer

Hi All,

 

I am interested in getting all the four points of a rectangle when using Rectangle selection.

I know how to do this using NXOpen.UIStyler.

1) using NXOpen.UIStyler, we can get the SelectionHandle

2) AskSelectionRectanglePosition gives us the four points of the rectangle drawn by the mouse.

 

I am looking ot do the same using a block styler. 

I have a custom dialog which has a curve selector which allows me to select curves in a sketch.

When there are many curves, I want to create a rectangle to select all the curves at once which lie within the rectangle..

I am looking to get all the points of the rectangle in this scenario.

 

Is there any API that can help me achieve this for block styler? 

Thanks in advance.

 

Regards,

Faisal

8 REPLIES

Re: How to get Rectangle Position Points using BlockStyler

Siemens Genius Siemens Genius
Siemens Genius

Do you want the points of the rectangle, or the selected objects?

Re: How to get Rectangle Position Points using BlockStyler

Siemens Genius Siemens Genius
Siemens Genius

You may also want to try posting on the NX Programming and Customization Forum.

Re: How to get Rectangle Position Points using BlockStyler

Pioneer
Pioneer
Sure! I will do that. thanks

Re: How to get Rectangle Position Points using BlockStyler

Pioneer
Pioneer

I want the points of rectangle. I will use these points to get more information about the objects within the rectangle.

Re: How to get Rectangle Position Points using BlockStyler

Siemens Genius Siemens Genius
Siemens Genius

You stated you are using the Curve Collector block - that supports multiple selection (including rectangle select) and returns an array of objects.  You would then need to process the array.  I am not sure there is a property for the points of the selection rectangle.

Re: How to get Rectangle Position Points using BlockStyler

Pioneer
Pioneer

You are right! 

I do have the list of objects in an array.

For my application, I require the rectangle points for the following reason.

I would like to get the points where the rectangle meets the curves. Refer the image attached.

As there is no direct API to get the points, I plan to ge those points using my own logic.

For this purpose I need the rectangle points.

Re: How to get Rectangle Position Points using BlockStyler

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

What do you plan on doing if the user has set the selection preference to "lasso" and there is no rectangle to get?

Re: How to get Rectangle Position Points using BlockStyler

Pioneer
Pioneer

The required selection preference is "Rectangle".

Even if lasso is selected, it will be changed to "Rectangle" at the start of tool execution.

Original settings will be reset at the end of execution.