• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Electrical

    Reply
    Valued Contributor
    Posts: 74
    Registered: ‎04-24-2012

    lisp routine and fileopen

    109 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

    Please use plain text.
    Distinguished Mentor
    rhesusminus
    Posts: 569
    Registered: ‎09-21-2007

    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. ;-)
    Please use plain text.