marcus007
05.10.2015, 03:38
ok so the deal is i handle a lot of third party drawings, i convert the drawings to my layers, text styles, text heights and text widths. I have tweaked the following lisp program i found online to convert text and mtext to my layer "htext", my textstyle "htext" and set the text height to 0.15625 multiplied by the current ltscale. the problem is with text width, my text style "htext" width is set to 1.0, i know that when you change an existing text's text style that piece of text takes on all the properties of the style. but in this program it only changes mtext width and not old fashioned single dtext. can you help a brother out?(defun c:c2Htext (/ textstyle layer selectionset integer selectionsetname obj) (setq sc (getvar "ltscale")) (setq newht (* sc 0.15625)) (vl-load-com) (if (tblsearch "style" "Romand") (setq textstyle t) (princ "\n Text Style <Romand> is not existed ") ) (if (tblsearch "LAYER" "Htext") (setq layer t) (princ "\n Layer <Htext> is not existed ") ) (if (setq selectionset (ssget "_:L" '((0 . "TEXT,MTEXT")))) (repeat (setq integer (sslength selectionset)) (setq selectionsetname (ssname selectionset (setq integer (1- integer)) ) ) (setq obj (vlax-ename->vla-object selectionsetname)) (vla-put-height obj newht) (vla-put-color obj 256) (if textstyle (vla-put-stylename obj "Romand") ) (if layer (vla-put-layer obj "Htext") ) ) (princ) ) (princ))