Author Topic: System variable  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

mohan

  • Newt
  • Posts: 98
System variable
« on: December 22, 2021, 02:40:10 AM »
Pls. help some system variable got changed !  :oops:

When I run this
Code: [Select]
(defun c:purgeblock ( / )
(repeat 3
(command "_.purge" "_b" "*" "_no")) (princ))

Command: purgeblock
_.purge
Command: _b Unknown command "B".  Press F1 for help.

Command: * Unknown command "*".  Press F1 for help.

Command: _no Unknown command "NO".  Press F1 for help.

Command: _.purge
Command: _b Unknown command "B".  Press F1 for help.

Command: * Unknown command "*".  Press F1 for help.

Command: _no Unknown command "NO".  Press F1 for help.

Command: _.purge
Command: _b Unknown command "B".  Press F1 for help.

Command: * Unknown command "*".  Press F1 for help.

Command: _no Unknown command "NO".  Press F1 for help.

dialogue block displays each time
"Save Energy"

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: System variable
« Reply #1 on: December 22, 2021, 03:24:03 AM »
Try -purge normal purge opens a dcl.
A man who never made a mistake never made anything

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: System variable
« Reply #2 on: December 22, 2021, 03:38:30 AM »
@Bigal,
 while called from a (command ...) LISP expression the dialog box is not used except when (initdia) is called before.

@mohan,
try with the complete name of the option.
Code - Auto/Visual Lisp: [Select]
  1. (defun c:purgeblock ( / )
  2. (command "_.purge" "_blocks" "*" "_no")) (princ))
Speaking English as a French Frog

mohan

  • Newt
  • Posts: 98
Re: System variable
« Reply #3 on: December 22, 2021, 04:01:32 AM »
Command: PURGEBLOCK Unknown command "BLOCKS".  Press F1 for help.
Unknown command "*".  Press F1 for help.
Unknown command "NO".  Press F1 for help.
Unknown command "BLOCKS".  Press F1 for help.
Unknown command "*".  Press F1 for help.
Unknown command "NO".  Press F1 for help.
Unknown command "BLOCKS".  Press F1 for help.
Unknown command "*".  Press F1 for help.
Unknown command "NO".  Press F1 for help.

Same error (dialogue block displays each time)

This Error was today from morning

yesterday I was working with script
Code: [Select]
QAFLAGS 31
_RECOVER "D:\Drawings\Hospital\BP2# Civil Package - 1\Landscape\L-100.dwg" _.qsave _.close
_RECOVER "D:\Drawings\Hospital\BP2# Civil Package - 1\Landscape\L-101.dwg" _.qsave _.close
_RECOVER "D:\Drawings\Hospital\BP2# Civil Package - 1\Landscape\L-301.dwg" _.qsave _.close
_RECOVER "D:\Drawings\Hospital\BP2# Civil Package - 1\Landscape\L-401+2+3.dwg" _.qsave _.close
_RECOVER "D:\Drawings\Hospital\BP2# Civil Package - 1\Landscape\L-410.dwg" _.qsave _.close
QAFLAGS 16
QUIT
;;End Script
;;End Script

Then one lisp I loaded
Code: [Select]
(defun c:rcdir ( / pth filelst)
(setq pth (getstring "\nType path where are *.dwg files to recover <ex. c:/.../.../> : "))
(setq filelst (vl-directory-files pth "*.dwg"))
(foreach file filelst (command "recoverall" (strcat pth file)))
(princ))
« Last Edit: December 22, 2021, 04:08:53 AM by mohan »
"Save Energy"

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: System variable
« Reply #4 on: December 22, 2021, 04:47:33 AM »
So, I was wrong about dialog box. @BIGAL was right.
Try this way:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:purgeblock ()
  2.   (repeat 3
  3.     (command "_.-purge" "_blocks" "*" "_no")) (princ))
Speaking English as a French Frog

mohan

  • Newt
  • Posts: 98
Re: System variable
« Reply #5 on: December 22, 2021, 06:57:53 AM »

Try this way:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:purgeblock ()
  2.   (repeat 3
  3.     (command "_.-purge" "_blocks" "*" "_no")) (princ))

Yes, this was working, but do I have to update all my lisps . . .
"Save Energy"

mohan

  • Newt
  • Posts: 98
Re: System variable
« Reply #6 on: January 03, 2022, 02:10:17 AM »
Hi Guys
The issue is this system variable got changed - QAFLAGS 31

Now all my previous lisps work fine.
"Save Energy"