I use Hurricane for most batch scripting. Comes with quite a few basic lisps/scripts.
http://www.74mph.com/
Crackin wee program.
|
I use Hurricane for most batch scripting. Comes with quite a few basic lisps/scripts.
http://www.74mph.com/
Crackin wee program.
scriptpro was written by autodesk (hasn't been updated in years, but still works, except for plotting on versions after 04 or 05).
this is great when turning over CAD files to another company, but would it be posible to also add something to Convert all Dynamic blocks to anonymous blocks which will disable the Dynamic features.
Example I found:
Code:(defun c:ConvertDyn (/ actDoc) (vl-load-com) (setq actDoc (vla-get-ActiveDocument (vlax-get-acad-object) ) ;_ end_vla-get-ActiveDocument ) ;_ end_setq (vla-startundomark actDoc) (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget "x" '((0 . "INSERT"))))) ) ;_ end_vl-remove-if (if (equal (vla-get-IsDynamicBlock (vlax-ename->vla-object x)) :vlax-true ) ;_ end_equal (vla-ConvertToAnonymousBlock (vlax-ename->vla-object x)) ) ;_ end_if ) ;_ end_foreach (vla-endundomark actDoc) (princ) ) ;_ end_defun ;;(princ "\nType ConvertDyn in command line to start lisp")
Last edited by Opie; 2009-09-22 at 01:13 PM. Reason: [code] tags added
Well... that code only accepts vla commands... lisp commands can be added to a batch process trough another lisp... I personally can do it now by using the Batch.lsp and and 2 other lisp files, 1 for your process and 1 for loading your first lisp, a starting script may help you adding orders to your lisp and then you can go trough many files and convert all dynamic blocks to annonymous.. need more help? let me know.
Using the same routine can i put one function which can collect all the xref attached to all the drawings and write it to a text file.
the function is given below also tell me where to add this function.
thanks
Code:(defun C:Get_Xref_Paths (/ fopen outputfile jbActiveDoc) (vl-load-com) (defun *error*(msg)(if fopen (close fopen))) ;;;; Creat the Drectory if it do not exist (if (not (vl-file-directory-p "D:\\CAD_Xref_Files\\"))(vl-mkdir "D:\\CAD_Xref_Files\\")) (setq outputfile (strcat "D:\\CAD_Xref_Files\\" "Xref_Dwgs_Path" ".txt")) (if (findfile outputfile) (setq fopen (open outputfile "a")) (setq fopen (open outputfile "w")) ) (setq jbActiveDoc (vlax-get-property (vlax-get-acad-object) 'activedocument)) (vlax-for X (vla-get-blocks jbActiveDoc)(if (= (vlax-get-property X "IsXRef") :vlax-true) (write-line (vla-get-path X) fopen))) (write-line "-------------------" fopen) (close fopen) ;(startapp "notepad.exe" outputfile) (princ) )
Last edited by Opie; 2010-04-28 at 01:32 PM. Reason: [code] tags added
Hi,
Can following things happen by editing your code?
1. Open Files from given folder
2. Purge All
3. Save in same folder where it was opened from.
4. Close
All these function are done in one folder in desired location which is awesome lisp.
I just want to add few more commands into LISP and the order of Command should be:
1. Open Files from given folder.
2. Go to Model.
3. Turn off Grid.
4. Zoom Extend.
5. Come back to Layout.
6. Purge all.
7. Save in same folder where it was opened from.
8. Close.
Can Anyone help me in this? I am short in learning LISP programming. Please help me with all 12 steps in one code?