Select current layer only with drag select

Started by aqua, February 02, 2007, 08:41:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aqua

Designcad 13.12


Does anyone know the extra code I can add the the macro below so that the drag window will only select items on layer 211

Regards Frank


'FM-3/2/2007
sys(80)=0
SetPoint "Right click to set point at start of corner arm span: ", 1
If Sys(1) < 1 Then End
Pointval x1 y1 z1 1

'Extra code - make only layer 211 available to drag select

>DragSelect
{
  <PointXYZ [x1-17.5,y1-.25,0]
  <PointXYZ [x1+17.5,y1+120,0]
  <Type 0
  }

>SetHandle
{
  <PointXYZ [x1,y1,0]
  }

>Rotate
{
  <Axis 2
  <Angle 10.0000
  <DragMode 1
  }
sys(80)=0


prl

Morning Frank (at least it is here for me).  Maybe something like this. Probably other ways too.


'FM-3/2/2007
sys(80)=0
SetPoint "Right click to set point at start of corner arm span: ", 1
If Sys(1) < 1 Then End
Pointval x1 y1 z1 1

>DragSelect
{
  <PointXYZ [x1-17.5,y1-.25,0]
  <PointXYZ [x1+17.5,y1+120,0]
  <Type 0
  }


'Extra code - make only layer 211 available to drag select
maxsel = sys(80)
for i = maxsel to 1 step -1
  getselect i, entid
  getattr entid, type, select, lay
  if lay <> 211 then putattr entid, type, 0
next i


>SetHandle
{
  <PointXYZ [x1,y1,0]
  }

>Rotate
{
  <Axis 2
  <Angle 10.0000
  <DragMode 1
  }
sys(80)=0

Lar

Quote from: prl on February 03, 2007, 04:55:55 AM


'Extra code - make only layer 211 available to drag select
maxsel = sys(80)
for i = maxsel to 1 step -1
  getselect i, entid
  getattr entid, type, select, lay
  if lay <> 211 then putattr entid, type, 0
next i



So the step function working now? That's good to know. It stopped working for me some time back (15, I think) and I had to re-write a few lines in some macros. After that I had to do some macro gymnastics to work around it.

Lar

prl

Frank, as Lar has pointed out, you'll have to verify if the step -1 works in version 13.  I can't remember.

aqua

I used the following code which I located in an earlier macro
This looks at each layer - and if it is visible, then it locks it.
At the end of the macro, I then unlocked them all.

Regards Frank


for i = 1 to 400
if layer(0+i) > 2 then layer(0+i)=2
next i