Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
matt_HH
415 Views, 3 Replies

LISP Bug

I am hoping someone a lot smarter than me can help. (I hope I'm in the right forum too)

 

I have a customised lisp routine that works very well for us. It WBLOCK's  a drawing and places it in a specified file.  The only issue I am having is that there is a FILEDIA trigger in there, that sets the variable to 0. The lisp says it is supposed to set it back to 1, but alas...does not.

After each time the routine is run, the FILEDIA needs to be manually changed back to . Not a huge deal....but a pain

 

Any guidance?

 

I have attached the lisp routine (.lsp), and also the displays at the command line after the routine has run. It is the txt file.

 

Please and thanks for any help on this bug

 

Matt

3 REPLIES 3
Message 2 of 4
Kent1Cooper
in reply to: matt_HH

It's trying to Save itself to its own filename, asking for confirmation to overwrite the existing file, and getting the Filedia command name as an answer, which it doesn't know what to do with.  If you're saving it to itself, QSave is easier than Save, so you could change this:

 

  (command ".save" "")

 

to this:

 

  (command ".qsave")

 

Or you could answer its question:

 

  (command ".save" "" "_yes")

 

Or you could give it a different file name to save to:

 

  (command ".save" SomeOtherFilePathAndName)

 

Or you could change the Expert System Variable setting so it doesn't ask whether or not you want to replace the existing file.

Kent Cooper, AIA
Message 3 of 4
matt_HH
in reply to: Kent1Cooper

HI Kent

 

I am not really sure what the .save command was actually trying to do anyway (saving the existing or the created drawing??), as earlier in the script a total new purged drawing is already created (in a specified folder.).

 

I just removed the reference to saving at all and set the filedia variable to 1

 


  ;(command "layer" "on" "*" "")
   (command "filedia" 1)

  (command "toolbar" "CustomHH.BurstPurgeOut" "Hide")
 
  ) ;_ end of defun C:HHQBLOCK

 

seems to work great now. A new flat purged drawing is placed in the separate folder and the existing drawing seems untouched. Unless I am missing something.

 

thanks very much

 

Matt

Message 4 of 4
Kent1Cooper
in reply to: matt_HH


@matt_HH wrote:

.... 

I just removed the reference to saving at all and set the filedia variable to 1

....

   (command "filedia" 1)
....


Since Filedia was set to 0 only just before that Save command, anyway, and you've removed that along with the Save, you no longer even need to set it back to 1 [provided it was set to 1 when you began].

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost