Jump to content

LISP help


Pommer93

Recommended Posts

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

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