Donut lisp routine...

Beaudin

Usenet Archive
Joined
Jan 12, 2004
Messages
5
Reaction score
0
Hi all.

I am looking for a lisp routine that will allow me to select all Donut objects in a drawing and change the outer diameter and inner diameter to my own specifications.

If anyone can help me out, I'd appreciate it!

Blaker
 
HINT: "donuts" are just closed, wide polylines made up of two 180 deg. arc segments.
___

Beaudin said:
I am looking for a lisp routine that will allow me to select all Donut
objects in a drawing and change the outer diameter and inner diameter to my own specifications.
 
Just a suggestion:
Since the donuts are LWPOLYLINES, but treated as a 'unit' when selected, you could get the 'center' point, and 'scale' them up or down.

Bob
 
Not if the adjustments of the inner/outer diameters are different.

ECCAD said:
Just a suggestion:
Since the donuts are LWPOLYLINES, but treated as a 'unit' when selected, you could get
the 'center' point, and 'scale' them up or down.
 
Yes,
Forgot about 'specifying'. You could grab the donut, get the center point, prompt for new inner and outer dia., then delete the 'old' donut, and construct a 'new' donut using the same center point ?
Bob
 
Yes, although you will have to calculate the
center point from the existing vertices.

ECCAD said:
You could grab the donut, get the center point, prompt for new inner and outer dia.,
then delete the 'old' donut, and construct a 'new' donut using the same center point ?
 
Your are right, based on following screen dump, the 'center' is not in there, except is listed on screen with 'list'.

Command: list
Select objects: 1 found

Select objects:
LWPOLYLINE Layer: "0"
Space: Model space
Color: BYLAYER Linetype: "CONTINUOUS"
Handle = 90
Closed
Constant width 0.7500
area 1.2272
perimeter 3.9270

at point X= 4.8125 Y= 12.5000 Z= 0.0000
bulge 1.0000
center X= 5.4375 Y= 12.5000 Z= 0.0000
radius 0.6250
start angle 180
end angle 0
at point X= 6.0625 Y= 12.5000 Z= 0.0000
bulge 1.0000
center X= 5.4375 Y= 12.5000 Z= 0.0000
radius 0.6250
start angle 0
end angle 180

Command: (setq obj (ssget))

Select objects: 1 found

Select objects: <Selection set: 2>

Command: (setq ent (ssname obj 0))
<Entity name: 40081f40>

Command: (setq don (entget ent))
((-1 . <Entity name: 40081f40>) (0 . "LWPOLYLINE") (330 . <Entity name:
40081cc0>) (5 . "90") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (6 . "Continuous") (100 . "AcDbPolyline") (90 . 2) (70 . 1) (43 . 0.75) (38 .
0.0) (39 . 0.0) (10 4.8125 12.5) (40 . 0.75) (41 . 0.75) (42 . 1.0) (10 6.0625
12.5) (40 . 0.75) (41 . 0.75) (42 . 1.0) (210 0.0 0.0 1.0))

Worse yet, the dfx 10 code is listed twise.
Bummer.
Bob
 
.... or apply a kludge like:
(osnap (cdr (assoc 10 (entget obj))) "cen")

where obj is the name of the donut.
___
 

Latest threads

Back
Top