Jump to content

Lisp Modification to change attribute to Mtext


acad1985

Recommended Posts

Hello all,

I have a routine that convert all the block attributes to Mtext. But it's not working properly. it will convert to Text only, but i want to convert Mtext.

Could anybody helps me?

 

(defun c:att2mt (/ )
  (setq TargEnt (car (entsel "\nSelect object on layer to select: ")))
  (setq TargLayer (assoc 8 (entget TargEnt)))
  (sssetfirst nil (ssget "_X" (list TargLayer)))
(c:burst)
(setq Tset (ssget '((0 . "*TEXT")))) 
(setq	Setlen (sslength Tset) 
Count 0
) ;setq
(repeat SetLen 
(setq Ename (ssname Tset Count)) 
(command "_txt2mtxt" Ename "")
(setq Count (+ 1 Count)) 
)	; Repeat	
(princ)
)

Thanks.

Link to comment
Share on other sites

Maybe I am reading the wrong intention of what you want to do, if the block is only an attribute then it would be easier to just recreate that attribute as new mtext, mtext asks for 2 points but you can use the insert position to work out pt1 the pt2 would be a fuzzy factor based on height and number of characters.

 

Best to post a dwg or image showing what is really required.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...