AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp routine and fileopen

1 REPLY 1
Reply
Message 1 of 2
acade2012
391 Views, 1 Reply

lisp routine and fileopen

Hello All,

I am running a lisp routine that creates a project with drawings pulled from a template.

 

All is working fine execpt at the end of the routine.

 

I open the first dwg in the project.

 

if the lisp program was started on a DWG that was saved before starting the lisp, the "fileopen" will fail due to the fact that the lisp first tells it to not save changes.

 

if i change the routine to assume that the dwg has been saved and its not, the "fileopen" fails again

 

Is there any way to tell if the current drawing has been saved???

 

Is there a way to save the current drawing in the routine?

 

Is there a better way to do this??

 

here is the end of the lisp for ref. "Y" is where it tells whether or not to save the current drawing

 

Thanks for any help

 

Dennis

 

 (close PROJECTFILE)                                                                                          ;closes project file

  (prompt "\nProject Creation Successful!")                                                            ;prompts good project created

   (c:wd_makeproj_current (strcat DWGDIR"/"JOBNUM".WDP"))                          ;makes new proj active

    (command "FILEOPEN" "Y" (strcat DWGDIR"/"JOBNUM"_MCP_001.DWG")) ;opens first drawing in project

     (c:ace_projwide_script  "" "(c:shtnum.lsp)")                                                       ;changes sheet # to = dwg #

      (PRINC)                                                                                                            ;peace out have a good day

1 REPLY 1
Message 2 of 2
rhesusminus
in reply to: acade2012

A simpe solution is to just make a change to the current document, so that it always is changed before you run your file open.

 

Add something like:

(command "LINE" "0,0" "10,10" "")
(command "ERASE" "L" "")

 


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost