Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 11 of 24 (1,643 Views)

Re: Convert Field to Text

11-15-2007 03:51 PM in reply to: *Jim Pehrsson
Hi,
you could try the attached lsp.
It coverts all fields in modelspace
text, mtext, mleaders and block attributes.
It does not convert text within
a block, or anything in a nested block.

Regards Ian
Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 12 of 24 (1,643 Views)

Re: Convert Field to Text

11-15-2007 09:23 PM in reply to: *Jim Pehrsson
Hi,
as a p.s. I changed the
original field removal function
from the entdel version to the
dictremove version, because
the dictremove version ignores
locked layers, whereas the
entdel version does not.
Regards Ian
New Member
onossa007
Posts: 2
Registered: ‎09-11-2007
Message 13 of 24 (1,643 Views)

Re: Convert Field to Text

01-22-2009 05:03 AM in reply to: *Jim Pehrsson
Because of my drawing (with Fields both on attributes and mtext, on several paper space layouts) are intended to be inserted inside another drawing, with obviously the lost of requested Object IDs, I should replace all fields presents in my drawing before it could be inserted...
Do you have a solution to do it in only one command ?

Thanks a lot for all your help !

(please excuse my poor "french english")
New Member
onossa007
Posts: 2
Registered: ‎09-11-2007
Message 14 of 24 (1,643 Views)

Re: Convert Field to Text

02-12-2009 02:37 PM in reply to: *Jim Pehrsson
Hi Ian,

I've tried to use your code, but in paper space, because it's where I have all my fields...
I've disabled the space control inside your code to not switch to tilemode 1.
I obtain no error, but all my fields stayed in place...
Do you have an idea of the reason why it doesn't work in paper space ?
To match my need, do you know about a code wich works in paperspaces (several layouts... But I don't mind in launching a comand in each one...
Thanks a lot for you big help !!!

Olivier
Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 15 of 24 (1,643 Views)

Re: Convert Field to Text

02-12-2009 04:09 PM in reply to: *Jim Pehrsson
Hi,
that code was written a few years ago.
While it worked fine in Autocad 2007
I have since discovered that it does not work
properly with Mtext & Dimensions in 2008 & 2009.
Attached is a revised version which does work.
I have changed it to only modify entities in paperspace.

Change the file name from R-FIELDS-PS.TXT
to R-FIELDS-PS.LSP

Regards Ian
Valued Contributor
MatteoJames
Posts: 83
Registered: ‎06-23-2008
Message 16 of 24 (1,643 Views)

Re: Convert Field to Text

03-13-2009 12:36 AM in reply to: *Jim Pehrsson
Hi Ian,

Looking at your lisp "R-FIELDS-PS" and I like it a lot cause I'm using fields everyday, and at the moment I've got a few drawings with more than 2000 fields in texts, dims, mtexts and block attributes. I have used your old version of the lisp posted before and like it a lot.

Now, looking at the code of "R-FIELDS-PS", I can't find the way to make it work only in model space insted of only paper space.

Can you, or some one, give me a hand to modify your lisp please?



Matteo.
Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 17 of 24 (1,643 Views)

Re: Convert Field to Text

03-13-2009 10:06 PM in reply to: *Jim Pehrsson
Hi,
change
(ssget "X"
(list
(cons 0 "TEXT,MTEXT,MULTILEADER,DIMENSION")
(cons 67 1)
)
)
to
(ssget "X"
(list
(cons 0 "TEXT,MTEXT,MULTILEADER,DIMENSION")
(cons 67 0)
)
)
regards Ian
Valued Contributor
MatteoJames
Posts: 83
Registered: ‎06-23-2008
Message 18 of 24 (1,643 Views)

Re: Convert Field to Text

03-16-2009 01:56 AM in reply to: *Jim Pehrsson
Thanks Ian!

It had to be something as stupid as a 0/1 switch. Just what I need :smileyhappy:



Matteo
Valued Mentor
Ian_Bryant
Posts: 362
Registered: ‎06-02-2005
Message 19 of 24 (1,643 Views)

Re: Convert Field to Text

03-17-2009 02:26 AM in reply to: *Jim Pehrsson
Hi,
You also need to change
(setq ss1
(ssget "X"
(list (cons 0 "INSERT")
(cons 67 1)
(cons 66 1)
)
)
)
to
(setq ss1
(ssget "X"
(list (cons 0 "INSERT")
(cons 67 0)
(cons 66 1)
)
)
)

Regards Ian
Valued Contributor
MatteoJames
Posts: 83
Registered: ‎06-23-2008
Message 20 of 24 (1,643 Views)

Re: Convert Field to Text

03-17-2009 02:38 AM in reply to: *Jim Pehrsson
Yep, I got that one on my own!



Thanks



Matteo
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.