DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Selecting current layer using 'same as'.

Started by adriank, October 03, 2019, 08:51:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Adrian 2.0

The forum's been quiet for a couple of days, thought I'd wake you all up with a grumble!

Here's a bug I've been living with for 20 years!
When I use the 'same as' finger to change layers in a drawing, the layer properties for the new layer don't load with the change.
Whatever line or colour options that were assigned to the previously current layer remain active.
The only way to get the layer properties to load correctly is to then open the layer list and re-select the current layer.

Seeing how I ALWAYS forget that last step until I'm frustrated that I can't change line style on an open layer, it'd be nice to see it fixed!

Adrian

Bob P


'this macro copies Layer, colour and linetype
'from one entity to one or more other entities

sys(80)=0
' Prompt user to select an item
setpoint "select object to copy from . . .", 1
' Get that XY Location where user clicked
pointval jx jy jz 1
' Select whatever's at that point
>PointSelect
{
<Type 0
<pointxyz [jx, jy, jz]
}
if sys(80)<>1 then
message "no object selected"
end
end if
' Get the Selected Item's ID
getselect 1, a
getattr a, type, select, laynum, group, red, green, blue
n=laynum
r=red
g=green
b=blue

sys(80)=0
' get Linetype,width and scale
>ID_LSTYLE_SAMEAS
{
<pointxyz [jx, jy, jz]
}

for z=1 to sys(9)
do while sys(80)=0
' Prompt user to select an item
setpoint "chose object to change . . .end with ESC", 1
sys(996)=1
' Get that XY Location where user clicked
pointval ix iy iz 1
' Select whatever's at that point
>PointSelect
{
<Type 0
<pointxyz [ix, iy, iz]
}
if sys(80)=0 then
message "no object selected!"
end if
loop
' Get the Selected Item's ID
getselect 1, i
getattr i, type, select, laynum, group, red, green, blue
laynum=n
red=r
green=g
blue=b
putattr i, type, select, laynum, group, red, green, blue

if sys(80)>0 then
>ApplyLineStyle
{
<ApplyLineType
<ApplyLineScale
<ApplyWidth
}

sys(80)=0
end if

next z

end