Visual LISP, AutoLISP and General Customization

Reply
Contributor
kumaran123
Posts: 24
Registered: ‎10-20-2008
Message 1 of 4 (184 Views)

Lisp Request

184 Views, 3 Replies
05-14-2013 12:49 AM
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
*Expert Elite*
3wood
Posts: 971
Registered: ‎03-25-2009
Message 2 of 4 (165 Views)

Re: Lisp Request

05-14-2013 03:45 AM 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?

 

Contributor
kumaran123
Posts: 24
Registered: ‎10-20-2008
Message 3 of 4 (158 Views)

Re: Lisp Request

05-14-2013 04:19 AM 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

*Expert Elite*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 4 of 4 (157 Views)

Re: Lisp Request

05-14-2013 04:20 AM 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

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community