
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi i want to make an LSP that can first burst the text in my file and then who can change all the text font to arial narrow
so this is what i have so far, this code can burst the text but not change it. Thanks for help
(defun C:NYBURSTLSP (/ flag ss1 ss2 ss3 ss4 entities len count ent ent_data ent_name new_style_name)
(vl-load-com)
(setvar 'TILEMODE 1)
(setq ss1 (ssget "X" '((0 . "INSERT"))))
(sssetfirst nil ss1)
(C:Burst)
(if (setq i -1 ss (ssget "X" '((0 . "MULTILEADER"))))
(while (setq ent (ssname ss (setq i (1+ i))))
(and (vlax-method-applicable-p
(setq obj (vlax-ename->vla-object ent)) 'Explode)
(vla-explode obj))
(entdel ent)))
(princ))
(setq flag (getvar "qaflags"))
(setvar "qaflags" 1)
(setq ss3 (ssget "X" '((8 . "Annotation"))))
(command "explode" ss3 "")
(setq ss4 (ssget "X" '((8 . "0"))))
(command "explode" ss4 "")
(setvar "qaflags" flag)
(princ)
(defun C:ChngFont (/ ss1 entities len count ent ent_data ent_name new_style_name)
(setq flag (getvar "qaflags"))
(setvar "qaflags" 1)
(setq ss1 (ssget "X" '((0 . "MTEXT"))))
(command "explode" ss1 "")
(setvar "qaflags" flag)
(princ)
(command "TILEMODE" "1")
(command "-STYLE" "Arial Narrow" "Arial Narrow" "0" "1" "0" "n" "n")
(setq entities (ssget "X" '((0 . "*TEXT")))
len (sslength entities)
count 0
);setq
(while (< count len)
(setq ent (ssname entities count)
ent_data (entget ent)
ent_name (cdr (assoc 7 ent_data))
);setq
(setq new_style_name (cons 7 "Arial Narrow"))
(setq ent_data (subst new_style_name (assoc 7 ent_data) ent_data))
(entmod ent_data)
(setq count (+ count 1))
);while
(setq ArialFont (strcat (getenv "systemroot") "\\Fonts\\Arial.ttf"))
(and
(setq StandardTextSTyle
(vla-item (vla-get-textstyles adoc) "Standard"))
(vlax-write-enabled-p StandardTextSTyle)
(vlax-property-available-p StandardTextSTyle 'Fontfile)
(vlax-put StandardTextSTyle 'Fontfile ArialFont)
)
)
Solved! Go to Solution.