News:

Please note new Forum URL: forum.designcad.com

Main Menu

>PolygonSelection can't be sticky

Started by PaulO, May 31, 2017, 11:55:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PaulO

Hello everyone,

for one of my macros I need to be able to select entities using a selection box at an arbitrary angle...  ::)  I was thinking about this for a long time, because >DragSelect obviously can't just be rotated.

The solution I came up with works for about half the cases I need the angled selection box. Basically, I'm using a series of complicated SIN() and COS() calculations after a quick >AngleDistance to calculate the four corner points of the angled selection box, then I run >PolygonSelection and pass it the four corner points.

This works fine if I want to get a similar behaviour to "Type 0" of >DragSelect, which only selects entities which are inside the selection box entirely. But if I want to select any entity touching the angled selection box, >PolygonSelection leaves me hanging.

Currently I don't see an easy way around this, but it could easily be fixed if the >PolygonSelection command offered you these "Types" of different selections as well, with one type being "select only items inside or touched by box".

Cheers
Paul

Rob S

You could consider temporarily rotating your entire drawing, and then using a normal selection box?
User since forever

DrollTroll

Maybe use SetWorkingPlane to temporarily rotate the coordinate axes, and then use dragselect? Calculating the new position of the bounding box would then require some mathematics, but it sounds like you're up to it. Then use ResetWorkingPlane when you're done.
25 years with DesignCAD