Pommer93 Posted May 14, 2019 Share Posted May 14, 2019 Hi! I made an code that can burst and change txt in my dwg but now i want to change my xref at same time when i but the script in my current drawing, can someone help me please? Here is my code so far. (vl-load-com) (defun C:NYBURSTLSP (/ flag ss1 ss2 ss3 ss4 entities len count ent ent_data ent_name new_style_name otlm) (setq otlm (getvar 'tilemode)) (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))) (if (setq ss3 (ssget "X" '((8 . "Annotation")))) (progn (initcommandversion) (command "explode" ss3 ""))) (if (setq ss4 (ssget "X" '((8 . "0")))) (progn (initcommandversion) (command "explode" ss4 ""))) (if (setq ss1 (ssget "X" '((0 . "MTEXT")))) (progn (initcommandversion) (command "explode" ss1 ""))) (command "-STYLE" "Arial Narrow" "Arial Narrow" "0" "1" "0" "n" "n") (setq entities (ssget "X" '((0 . "*TEXT"))) len (sslength entities) count 0) (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 (vla-get-activedocument (vlax-get-acad-object))) "Standard")) (vlax-write-enabled-p StandardTextSTyle) (vlax-property-available-p StandardTextSTyle 'Fontfile) (vlax-put StandardTextSTyle 'Fontfile ArialFont) ) (setvar 'tilemode otlm) (princ) ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.