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.

"same as"

Started by j-wetzel, September 09, 2013, 02:33:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

j-wetzel

First I need to thank all of you experts who responded to my earlier post "Weird printing problem" in March of this year.  It was rude of me not to respond, but what happened is that I found a work-around and simply forgot to check the Forum for responses.  Sorry.

My question this time is certain to be a whole lot easier.  I want to incorporate the "same as" command (the outline arrow at the top of the INFO BOX) in a tool box.  There are lots of "same as" commands listed as available on the Options (Q) menu, but none of them seems to be the same as the one I want--the one in the INFO BOX seems to incorporate the actions of several of those listed.  Can anyone tell me how to get this command into my "Frequen(t)" toolbox?  I'd be grateful.
--Jack

Bob P

Not my work, and unfortunately I don't remember who wrote this.  Make a button that runs this macro.

'clt.d3m
'This macro copies Layer, colour and linetype
'from one entity to others

sys(80)=0
' Prompt user to select an item
setpoint "select object . . .", 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

Lar

Interesting macro Bob. I like how the changes can be undone however it doesn't copy the fixed lineweight and it changes the active linetype to that of the first selected.

Lar