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.

Change line width of grouped items

Started by aqua, July 07, 2008, 06:56:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aqua

Designcad 13.13

Can anyone assist to finalise the following macro.
It is designed to change the line width of some circles that form part of grouped items.

1: Looking for the extra code that will ensure the circles are grouped with the original items.
2: Looking for the extra code that will ensure part circle arcs are drawn as such - at the moment I have it drawing full circles

Regards Frank



'FTM-7/7/2008
layer(207)=6
Input "Enter wheel track line thickness, example 1, suggest 5 for images:", Trackthickness$
sys(3)=207

'For all items in the drawing, would prefer to look at only layer 207 items
'When erasing items, code can be an issue, I think we need the sys(9) and step - 1 stuff
OrgCount = Sys(9)
For i = OrgCount to 1 Step -1
Entity i
    getattr i, type, select, layr, group, red, green, blue
Pointval x1 y1 z1 1
Pointval x2 y2 z2 2
'Pointval x3 y3 z3 3
if type = 16 then radiussize = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1))
'Type 1 = Line , Type 4 = Curve, Type 16 = Circle, Type 17  = Hatch
    If type = 16 And layr = 207 and radiussize > 20 then
        Gosub fixup
    End If
Next i
End


' Subroutine fixup
fixup:
Entity i
Pointval xc yc zc 1
Linetypefm = Sys(91)
Sys(1) = 0 ' clear points
Sys(80) = 0 ' clear selection (just in case)
PutAttr i, 16, 1 ' select the point mark, then erase it
>Erase
{
}
'Need to identify group
'Select item when created?
>Circle4
{
<LineStyle [Linetypefm,20.0000,Trackthickness$]
<Color [red,green,blue]
<Type 0
<Radius [radiussize]
<Pointxyz [x1, y1, 0]
}

'putattr i, type, select, layr, group, red, green, blue
sys(80)=0
Return

SilentType

Not sure if you are still looking for a response to this one. I'm not even sure that I follow what you've done in your code.

But if you are only trying to change the line width then I think it would be easiest to:

1. Set the current line width to what you want sys(6) = ?
2. Step through all the entities (like your currently doing). Identify it as a line or arc or whatever you are after. And select it (change value of Select from GetAttr to 1 using PutAttr).
3. Once it's selected all the arcs & circles use the following to apply the current line width to the currently selected entities.
>ApplyLineWidth
{
}

This way you have never actually ungrouped the items -as you are working with the original entities.

Not really sure I'm even answering the right question.

ST