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.

Macro Line Width

Started by Varied Products, September 15, 2009, 02:43:17 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Varied Products

Looking for some much needed help to create a macro so I can apply a line width(Fill Wide Line needs to be checked) to all existing objects(circles, vectors, arcs) on a specific layer. Inputs would be layer#, line width. I tried many different SYS functions but to no avail.

Mark Laing

It's not done with the sys functions. Or I mean I wouldn't do it that way. I'd use the 'query' and 'change' functions. Search this board for the Macros17 help file. That'll explain a lot.

bdeck

Here's a rough outline

BD



Alias ENT_LINEWIDTH  &H0108  

n=sys(9)

for i=1 to n

Entity i

Change Ent_LineWidth, 0.25
   
Update     'ALWAYS Update the entity when done with Change

next i

End

Mark Laing

Here's a slightly more fleshed out version (it works, as is)
=======================================================
sys(800) = 0
INCLUDE "*\DcadAlias.d3i"
sys(1027) = 0
On Error Goto handler
If sys(80)= 0 then
>selectall
{
}
endif
precision 0
Input "Which Layer?", wantlay
Input "What Width?", width
'message "There are ", sys(80), "Entities to process."
For i = 1 to sys(80)
getselect i, entnum
entity entnum
query ent_type, e
'message "entity type number is ", e
Query Ent_Layer, curlay
if curlay = wantlay then
Query Ent_LineFill, elfilled
if elfilled = 1 then
Change Ent_LineWidth,width
Update
endif
endif
Update
change d_textsize, Sys(12)
Update
Next i
Update
>DeSelect
{
}
Regen
'message "done"
End
===================================
This version completely ignores lines with  'line style by layer' checked. You can check, or uncheck, that in the info box.