AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

Reply
Distinguished Contributor
acade2012
Posts: 116
Registered: ‎04-24-2012
Message 1 of 2 (164 Views)

lisp routine and fileopen

164 Views, 1 Replies
12-05-2012 01:10 PM

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

*Expert Elite*
rhesusminus
Posts: 910
Registered: ‎09-21-2007
Message 2 of 2 (150 Views)

Re: lisp routine and fileopen

12-06-2012 04:37 AM 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" "")

 


THL
Please select "Accept As Solution" if this post answers your question. Kudos don't hurt either. ;-)
Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.