Wdobbin Posted December 14, 2021 Posted December 14, 2021 I am trying to create a lisp that opens a template file"sheet1" from a specific folder the code is as shown below however it is not working, any help would be appreciated. (SETVAR "FILEDIA" 0) (COMMAND "_OPEN" "C:/Data/Working/TEMPLATE/Sheets/Sheet1") (SETVAR "TILEMODE" 1) (COMMAND "-XREF" "O" "C:/Data/Working/TEMPLATE/XR_Aerial_2021.dwg" "0,0" "1" "1" "0") (SETVAR "TILEMODE" 0) (SETVAR "FILEDIA" 0) (COMMAND "_SAVEAS" "C:/Data/Working/SAVELOCATION/310204874-01-001-C016") (COMMAND "_CLOSE") ) Quote
Steven P Posted December 15, 2021 Posted December 15, 2021 Can I guess that it is 'not working' after the line (COMMAND "_OPEN" "C:/Data/Working/TEMPLATE/Sheets/Sheet1") - the LISP is running in one drawing and when you open another the focus changes to that drawing.. which isn't running the LISP routine, and so it will all stop. Someone might be along to show how to make it work, not something I have needed to do really. Quote
exceed Posted December 15, 2021 Posted December 15, 2021 copy files to destination folder add that lisp appload > contents > start up suits (except open command) open all of the drawing. saveall command -> closeall command complete. then delete lisp in start up suits script or open function is high level. but this way is simple for me Quote
mhupp Posted December 15, 2021 Posted December 15, 2021 Are you trying to make a title block by opening the template and then attaching the drawing to it thought xref? seems kinda backwards. read over this. Quote
BIGAL Posted December 16, 2021 Posted December 16, 2021 (edited) Just save all your code as a script should work. You can write script file as part of a lisp do change the filenames etc last line is (command "script" "scriptname") Note remove last ) not needed. Edited December 16, 2021 by BIGAL Quote
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.