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

08 mtext back to 2000

1 REPLY 1
Reply
Message 1 of 2
curmudgeon
213 Views, 1 Reply

08 mtext back to 2000

I use Autocad 2000 and I have files that were created in release 08. I use DWG Trueview 08 to convert files back to where I can edit them. However, the mtext conversion was kind of poorly written. Bullets were used in the mtext, and not backwardly compatible, but the "fix" they made used \\P at every line break. I could parse those out, but the way entget functions, it seems to have a limit on number of characters for a text string that is getting exceeded.

in short, if I entget, the text gets clipped. not good.
I resolved that I could explode the mtext and recreate it with my own bullets. it could be done.

but then I began to wonder if anybody else had already solved this, or had any thought on it that would shorten the learning curve.

thanks.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: curmudgeon

With regular AutoLisp you would use (entget). With MTEXT, code 1 holds a
maximum of 250 characters. Strings longer than 250 characters are spilled
over into code 3s, each containing the 250 character max. So the method
would be something like...
(setq ent (entget e)) ; where e is the MTEXT entity
(setq str (cdr (assoc 1 ent)))
(while (setq ent (member (assoc 3 ent) ent))
(setq str (strcat str (cdar ent))
ent (cdr ent)
)
)

But if you can get into VisualLisp you can access the entire string in one
chunk...
(vl-load-com) ; to get the ActiveX engine running
(setq Object (vlax-ename->vla-object e)) ; VLA-Object
(setq str (vlax-get Object 'TextString))

--
John Uhden, Cadlantic

http://www.cadlantic.com
Sea Girt, NJ

wrote in message news:6097208@discussion.autodesk.com...
I use Autocad 2000 and I have files that were created in release 08. I use
DWG Trueview 08 to convert files back to where I can edit them. However, the
mtext conversion was kind of poorly written. Bullets were used in the mtext,
and not backwardly compatible, but the "fix" they made used \\P at every
line break. I could parse those out, but the way entget functions, it seems
to have a limit on number of characters for a text string that is getting
exceeded. in short, if I entget, the text gets clipped. not good. I resolved
that I could explode the mtext and recreate it with my own bullets. it could
be done. but then I began to wonder if anybody else had already solved this,
or had any thought on it that would shorten the learning curve. thanks.

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

Post to forums  

Autodesk Design & Make Report

”Boost