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

modify lisp

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
hamid.akbari
523 Views, 6 Replies

modify lisp

Hi

Attached lisp file only works with dtext objects but I am going to work with Mtext too. 

Thanks a lot

Hamid

6 REPLIES 6
Message 2 of 7
Kent1Cooper
in reply to: hamid.akbari


@hamid.akbari wrote:

....

Attached lisp file only works with dtext objects but I am going to work with Mtext too. 

....


You should be able to do that by replacing this line:

(setq ss (ssget '((0 . "TEXT"))))

with this:

(setq ss (ssget '((0 . "*TEXT"))))

 

That's assuming you don't have any RTEXT that you would not want it to process.  In case you might, you could use this instead:

(setq ss (ssget '((0 . "TEXT,MTEXT"))))

 

[And by the way, there is no such thing as a DTEXT object.  DTEXT is a command, for the most part identical to the TEXT command for many years (it's a long story), but the objects it makes are just TEXT.]

Kent Cooper, AIA
Message 3 of 7
hamid.akbari
in reply to: Kent1Cooper

Thanks but it still dosent work!

Message 4 of 7
hmsilva
in reply to: hamid.akbari

See the attached file...

UNTESTED

 

HTH

Henrique

EESignature

Message 5 of 7
Kent1Cooper
in reply to: hamid.akbari


@hamid.akbari wrote:

Thanks but it still dosent work!


I'm a little puzzled as to why it works for Text and not Mtext with the following:

 

(setq elist (list (cons -1 ent) (cons 1 nstr)))
(entmod elist)

 

It doesn't seem like it ought to, even for plain Text, since it seems to be making an entire entity data list out of just an entity name and Text content, without any of the other elements [Layer, Style, height, etc.].  But try replacing those lines with the way I would typically expect to see that done:

 

(setq entd (subst (cons 1 nstr) (assoc 1 entd) entd))
(entmod entd)

 

which works for me, for both Text and Mtext, in limited testing.

Kent Cooper, AIA
Message 6 of 7
Lee_Mac
in reply to: Kent1Cooper


@Kent1Cooper wrote:

@hamid.akbari wrote:

Thanks but it still dosent work!


I'm a little puzzled as to why it works for Text and not Mtext with the following:

 

(setq elist (list (cons -1 ent) (cons 1 nstr)))
(entmod elist)


Only certain entity types can be modified using this method, usually those which do not require subclass markers (DXF 100) when created with entmake. Here is an incomplete list:

 

TYPE      MODIFIED USING ONLY ENAME?
=====================================
ARC                   YES
ATTRIB (SINGLE)       YES
ATTRIB (MULTI)        NO
CIRCLE                YES
ELLIPSE               NO
HATCH                 NO
INSERT                YES
LINE                  YES
LWPOLYLINE            NO
MTEXT                 NO
POINT                 YES
POLYLINE              YES
SPLINE                NO
TEXT                  YES
XLINE                 NO

Message 7 of 7
nagarajan05d63
in reply to: Lee_Mac

Hi any one know how to create co-ordinate dimesnion for particular drawing using lisp program or something else. I have tried lisp but i'm getting the co'ordinate value in 5digit like (12345.635) i changed the ucs also but no use same thing only i'm getting. Please if any one know tell me...

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

Post to forums  

Autodesk Design & Make Report

”Boost