Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Lisp Help

jonathan.andrewsen
Explorer

Lisp Help

jonathan.andrewsen
Explorer
Explorer

I want a lisp that can allow set a folder, open those dwg files, bind (insert) all xrefs, purge and close but save the files as the name in the sheet set manager is that possible?

 

Example: 

 

Save file from

JOB#-SHTS-SITE.DWG

 

Save file as

C1.0_Site Plan

(SSM Number)_(SSM Sheet Title)

0 Likes
Reply
258 Views
1 Reply
Reply (1)

LDShaw
Advocate
Advocate

Lisp no but Lee Macs Scriptwriter can give you the bones you need to do it.

If you can find\build a lisp that will do the steps in a single dwg (_-etransmit perhaps) you can add it to the dialog box wscript gives you and it will run through folders\subfolders for files. (Note if the xref are in the same folder you may have a bit of a problem.)

Here is an example 
This will
Open a file
load a lisp I want it to run.
Load another lisp
save it under the same name
then close the file. 

 

 

_.open *file* (load "C:\\dcapps\\test\\drag and drop update fonts.lsp") (load "C:\\dcapps\\test\\width height text change rev 3.lsp") _.saveas  *file* _.close

 

 

 This is the config file it wrote.
You can find the files it creates here if you want to edit them. 
(getvar 'ROAMABLEROOTPREFIX)


 

 

"_.open *file* (load "C:\\dcapps\\test\\drag and drop update fonts.lsp") (load "C:\\dcapps\\test\\width height text change rev 3.lsp") _.saveas  *file* _.close"
"\\\\Cadd\\DC ACAD\\DEFAULT\\Mech\\DC Mech Details\\temp"
"0"
nil

 

 

Here is one of the lisp it's loading. 

 

  (if (findfile (setq f (strcat (getenv "windir") "\\Fonts\\Arial.ttf")))
      (progn
        (vlax-for s (vla-get-textstyles (setq doc (vla-get-activedocument (vlax-get-acad-object))))
          (vla-put-fontfile s f)
          (vla-put-width s 1.0)
          ;; RJP » 2020-04-29
          (vla-setfont s "Arial" :vlax-false :vlax-false 0 34)
        )
        (vla-regen doc acallviewports)
        (princ "\nArial font set for all text styles and document regenerated.")
      )
      (princ "\nArial.ttf not found in the Fonts directory.")
  )

 

As you can see it just runs. no (defun c:foo) to launch it. 


0 Likes