Jump to content

Opening a drawing through the command line


Recommended Posts

Posted

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

Posted

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.

Posted

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

 

 

Posted

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.

 

Posted (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 by BIGAL

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