Jump to content

Recommended Posts

Posted

Hello,

 

This is my very first post here. I was wondering if I get some ideas\help to complete my project.

In the attachment you will find closed polygons with labels inside of it. My work here is I have to tag the labels with the polygon.

And these labels has to be divided into two sets,

For example in the attachment you will fond the labels like the same in the below, 

 

083S  016 

 

I wanted make above labels in two different rows, I mean 083S in the first row and 016 in the second row(just wanted to separate) .

testing.dwg

Posted (edited)

Use lisp to convert to mtext, and then change the width in the properties.

(defun C:Demo (/ ss i elist)
  (setq ss (ssget "_X" (list (cons 0 "TEXT"))))
  (setq i -1)
  (if ss
    (repeat (sslength ss)
      (setq elist (cdr (assoc -1 (entget (ssname ss (setq i (1+ i)))))))
      (command "TXT2MTXT" elist ""); Express Tools command
    );repeat
    );if
  )

 

Edited by JuniorNogueira
Posted

This :

(setq elist (cdr (assoc -1 (entget (ssname ss (setq i (1+ i)))))))

Is equal to :

(setq elist (ssname ss (setq i (1+ i))))

 

  • Confused 1
Posted

A bettter way is that mtext supports newline so if its 1 text line "083S  016" then use a look for space split into two and join back with a \\P from memory "083S\n016"

 

your string TextString = "083S 001\\P(DEFFERED)"

 

This is the answer but I have to go right now someone else will jump in very easy. copy 1st line to command line then second pick your mtext.

(setq obj (vlax-ename->vla-object (car (entsel "pick object"))))
(vla-put-textstring obj "083S\\P001\\P(DEFFERED)")

 

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...