Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp Request

3 REPLIES 3
Reply
Message 1 of 4
kumaran123
367 Views, 3 Replies

Lisp Request

Dear Friends, I have several donuts and blocks with id points. (SEE THE ATTACHED DRG) I need to change all donuts size together and ID point should be the same. similarly the text also to be changed globally with same ID. can anyone send me a lisp for this operation. thanks a lot ( see the attached Drg for your reference) ALSO nee to insert new DONUT or similar blocks at purticulat coordinates. thanks & appreciate
3 REPLIES 3
Message 2 of 4
3wood
in reply to: kumaran123

If they were blocks with attributes it would be much easier.

 

I am thinking is it possible scale everything from basepoint A by factor N, then use a lisp to move everything along individual polar direction from basepoint A, by a certain distance as result calculated with N and Distance between  object and basepoint A?

 

Message 3 of 4
kumaran123
in reply to: kumaran123

I'Im not able to develop LIPS program, earlier I received this mail from our group. if this may help to develop, please try.

A Donut is a two-semi-circular-arc-segment Polyline forming a circle, with a constant non-zero width. You could have a routine find all Donuts this way:

{code}
(setq donuts
(ssget "X"
'(
(0 . "LWPOLYLINE")
(-4 . "")
(-4 . "!=") (43 . 0.0)
(90 . 2)
); end filter list
); end ssget
); end setq
{code}

The (42 . 1.0) with its NOT surroundings will see Polylines with bulge factors *only* for full semi-circle arc segments [Donuts have two each like that, and none with other values]. The (43 . 0.0) with its not-equal prefix will find only those with a global width, but one that is not zero. The (90 . 2) will find only those with exactly two vertices. [If you might have any Donuts that are "heavy" 2D Polylines (made with PLINETYPE=0), you'll have to do other things to find them.]

To change the size of each of them in place, if the "ID point" is at the center, you'd need to *calculate* their center points to use as Scale base points, because they are not part of the entity data. If 'ent' is a Donut's entity name from the selection set, this is one way to get its center point, halfway between its two vertices:

{code}
(mapcar '/
(mapcar '+
(vlax-curve-getPointAtParam ent 0)
(vlax-curve-getPointAtParam ent 1)
); end inner mapcar
'(2 2 2)
); end mapcar
{code}

A start....

--
Kent Cooper

Message 4 of 4
pbejse
in reply to: kumaran123


@kumaran123 wrote:
Dear Friends, I have several donuts and blocks with id points. (SEE THE ATTACHED DRG) I need to change all donuts size together and ID point should be the same. similarly the text also to be changed globally with same ID. can anyone send me a lisp for this operation. thanks a lot ( see the attached Drg for your reference) ALSO nee to insert new DONUT or similar blocks at purticulat coordinates. thanks & appreciate

What we need to see is the before and after kumaran123

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost