Author Topic: How do I select a bunch of Construction Lines  (Read 179 times)

Lar

  • Hero Member
  • *****
  • Posts: 2513
How do I select a bunch of Construction Lines
« on: August 22, 2017, 09:47:16 AM »

Hi all.


I don't use Construction Lines but I recently tested and it seems the only way to select control lines is either click on them or via selection filter>"new selection" button.


Clicking to select means you have to select one at a time and using the selection filter means you get all at once.


Is there a way to select a bunch of constr-lines similar to the ctrl+dragging method (since you can't ever do a selection box around a entire const-line)?


Lar

bdeck

  • Hero Member
  • *****
  • Posts: 807
Re: How do I select a bunch of Construction Lines
« Reply #1 on: August 23, 2017, 10:02:01 AM »
...  either click on them or via selection filter>"new selection" button.

Hi Lar,
You could also use "k" (line snap) within the "s" (OR-select) macro here:
http://forum.designcadcommunity.com/index.php?topic=322.msg1404#msg1404

If you want to select exactly two items, remember to add a third selection point to avoid a rectangular selection.

bd

Lar

  • Hero Member
  • *****
  • Posts: 2513
Re: How do I select a bunch of Construction Lines
« Reply #2 on: August 23, 2017, 10:40:15 AM »

BD,


I copied v 0.8 and ran it but I keep getting an invalid syntax on line 17 error. I am never able to determine what exact line dcad refers to when it gives a line number and the only problem syntax I saw was "endif" instead of "end if", all of which I changed, but am still getting the error.


Other than that, I can not determine from the instructions or code exactly what the macro is supposed to do but it seems like I still have to click on each construction line individually, which I'm trying to avoid.


What I would like to do is, like during normal operation, to hold the ctrl key while I drag a box across the c-lines and what ever construction lines crosses  the box gets selected. This does not happen on my system. I can click on a c-line and it gets selected, but what if  have 98 c-lines?


Note that its impossible to completely box a c-line since their lengths always run off the window.


Lar

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4145
Re: How do I select a bunch of Construction Lines
« Reply #3 on: August 23, 2017, 12:01:52 PM »
I think it's just a limitation of how the overall selection system works, versus the way construction lines are specified. C-lines are essentially cosmetic constructs; the points defining them only actually specify a short line segment. If you're not close to that segment when trying to select, you'll 'miss'.

I maybe able to cobble together a macro that lets you specify a rectangle, then checks all construction lines to see if their line equations touch that rectangle anywhere and selects the ones that do.
25 years with DesignCAD

Lar

  • Hero Member
  • *****
  • Posts: 2513
Re: How do I select a bunch of Construction Lines
« Reply #4 on: August 24, 2017, 08:20:18 AM »

Good idea, DT.

bdeck

  • Hero Member
  • *****
  • Posts: 807
Re: How do I select a bunch of Construction Lines
« Reply #5 on: August 24, 2017, 02:52:23 PM »

I copied v 0.8 and ran it but I keep getting an invalid syntax on line 17 error. 

Hi Lar,

I copied the same file, and did not get an error on my system, but the download did fail file-compare with the original. Other than spaces (hex 20) I could not find any differences between the two. However the file NMS14.zip in the OP of that thread downloaded cleanly.

I wrote the original of this macro about 15 years ago. I use it daily, but rarely in 3d. So it may need some attention.  I notice that version 17 of the sdk recommends commas in the setpoint statement.

Quote
Other than that, I can not determine from the instructions or code exactly what the macro is supposed to do but it seems like I still have to click on each construction line individually, which I'm trying to avoid.
Instructions  (if not in preset point mode):
1) Run macro
2) set 1-98 points
3) hit enter

Instructions  (if in preset point mode):
1) set 1-98 points
2) Run macro

Result:

If 1 point is set:
   One entity or group nearest the point is selected.
If 2 points are set:
   Entities entirely within a rectangle defined by those two points are selected.
If 3 or more points are set:
   Entities nearest the set points (if within the selection radius) are selected.

S.d3m is an "OR-select" macro

Works basically like the select function in version 6, with the following improvements:

Eliminates the XOR logic which causes DC to deselect previously selected items when you click them or enclose them in a selection rectangle. It only selects, never deselects.  The macro first archives any existing selection set, deselects it, selects the new set (by Pointselect or Dragselect), then merges the old selection with the new selection. 

Allows use of "esc" key to unset points in reverse order. (without deselecting the entire selection set)

Allows use of any point-setting keys (eg. "k") in multiple selections. DC natively allows those keys only for selecting a single entity or group.

Quote
What I would like to do is, like during normal operation, to hold the ctrl key while I drag a box across the c-lines and what ever construction lines crosses  the box gets selected. This does not happen on my system. I can click on a c-line and it gets selected, but what if  have 98 c-lines? 

Can't help you there. As you know, BasicCad doesn't recognize upstrokes and has no timers. Also the "Dragselect" function does not appear to recognize construction lines, regardless of the setting of the "t" parameter.  DT seems to have the best solution.

As you point out, the macro's arbitrary limit of 98 selection points is kind of silly, and can be edited to any value up to and exceeding sys(9) (Two points on the same entity is not a problem).  Or, after selecting up to 98 entities, you can select another 98 without worrying about DC's XOR mode deselecting any of the first 98.   

If you have 98 c-lines, you would have to click, at most, 49 of them to select a subset.  Modifying a few lines in the macro could result in a nice deselect macro as well. (Using shifted mouse clicks to select or deselect is frustratingly unreliable on my system recently.  I try to avoid shifted operations of any kind. )

Best Regards,
bd
« Last Edit: August 24, 2017, 03:03:25 PM by bdeck »

Lar

  • Hero Member
  • *****
  • Posts: 2513
Re: How do I select a bunch of Construction Lines
« Reply #6 on: August 28, 2017, 08:47:46 AM »


What I would like to do is, like during normal operation, to hold the ctrl key while I drag a box across the c-lines and what ever construction lines crosses  the box gets selected. This does not happen on my system. I can click on a c-line and it gets selected, but what if  have 98 c-lines? 

Can't help you there. As you know, BasicCad doesn't recognize upstrokes and has no timers. Also the "Dragselect" function does not appear to recognize construction lines, regardless of the setting of the "t" parameter.  DT seems to have the best solution.


Thanks for the confirmation BD.


As for the macro not running, maybe it has to do with the version I'm running (the very, very latest, as of this writing)


Lar

bdeck

  • Hero Member
  • *****
  • Posts: 807
Re: How do I select a bunch of Construction Lines
« Reply #7 on: September 04, 2017, 05:31:48 PM »
I don't use Construction Lines but I recently tested and it seems the only way to select control lines is either click on them or via selection filter>"new selection" button.

I dont use construction lines either. Mainly because I can't seem to find a way to Trim a line to one. So the only command that seems to work with them is "k."  Maybe someone else can fill us in on how they are used.

Nevertheless, I could not resist the challenge.  See attached.

Best Regards
BD

EDIT  PS: Although Trim does not work with construction lines, point commands such as "k" and  Intersect 1 & 2 seem to work ok. So I guess it should not be too hard to automate an E command. 
« Last Edit: September 04, 2017, 10:08:55 PM by bdeck »

Lar

  • Hero Member
  • *****
  • Posts: 2513
Re: How do I select a bunch of Construction Lines
« Reply #8 on: September 05, 2017, 11:19:59 AM »
Good work on your macro, bdeck.

Works great in 2d mode. I couldn't get it to work in 3d but that's understandable (and don't take that as a challenge. You did plenty already - like relieving DT of his promise so he now has lots of time to fix Red mode).

I also notice that any fixed lineweight other than zero does not display on screen (2 & 3d modes), even though editable via the info box.


Lar
« Last Edit: September 05, 2017, 11:25:26 AM by Lar »

bdeck

  • Hero Member
  • *****
  • Posts: 807
Re: How do I select a bunch of Construction Lines
« Reply #9 on: September 06, 2017, 03:49:22 PM »
Thanks, Lar.

In 3d on my system (32 bit dcv26.2) it works in the xy (front) view to select within an unlimited 3D projection of the 2D box.

In the other views one needs to first set a workplane to use the macro.
(View/Workplane/SetWorkplane, LMB, shift LMB, Shift LMB)

Workplane/Unworkplane could be automated in the macro, but that can wait for another day.
A true limited 3D selection can wait a bit longer.  8)

bd