Author Topic: Generating a log file of sysvars for the open drawing?  (Read 4585 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
Generating a log file of sysvars for the open drawing?
« on: November 15, 2011, 02:50:11 PM »
Just curious, I'm sure you guys had one before I read but my memory is failing on what it was on.
I was goofing around trying to get my SYSVARS to list in a log file for the drawing I have open.
But using the SET command doesn't work from lisp.

Code: [Select]
(defun c:sysvars()
;======================================================================
; Turn off command line responses
;======================================================================
(setvar "CMDECHO" 0); DO NOT CHANGE THIS LINE
;======================================================================
(command "LOGFILEON")
(princ "\n   Logging turned on!!\n")
(command "INPUTHISTORYMODE" 0)
;======================================================================
(princ "\n   Begin listing SYSVARS!!\n")
(command "SET" "?" "*")

;======================================================================
; Turn on command line responses
;======================================================================
(setvar "CMDECHO" 1); DO NOT CHANGE THIS LINE
;======================================================================
(command "INPUTHISTORYMODE" 5)
(princ "\n   Logging SYSVARS successful!!\n")
(command "LOGFILEOFF")
)

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Generating a log file of sysvars for the open drawing?
« Reply #1 on: November 15, 2011, 03:49:43 PM »
SET is the command alias for SETVAR.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Generating a log file of sysvars for the open drawing?
« Reply #2 on: November 15, 2011, 05:52:55 PM »
Alternatively, you could just use SYSVDLG and click 'SaveAll' - the resultant .svf file is Text file format.  :-)

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Generating a log file of sysvars for the open drawing?
« Reply #3 on: November 15, 2011, 05:59:39 PM »
Or perhaps use command Alan mentioned once on AUGI, VARS2SCR and export variables into *.scr file witch is also Text file format...

M.R. :-)
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

KewlToyZ

  • Guest
Re: Generating a log file of sysvars for the open drawing?
« Reply #4 on: November 15, 2011, 06:12:25 PM »
That's the program I was trying to remember!!!
Hmmmm now if I can just find what file the code is in....lol
I have it come up in my command list and function, I just don't remember what it was named...
doh!!!
« Last Edit: November 15, 2011, 06:33:20 PM by KewlToyZ »

KewlToyZ

  • Guest
Re: Generating a log file of sysvars for the open drawing?
« Reply #5 on: November 15, 2011, 06:38:50 PM »
OK that is integrated into AutoCAD.
I'll have to take a look and see if the code is available to check it out.
Thanks guys  8-)

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Generating a log file of sysvars for the open drawing?
« Reply #6 on: November 15, 2011, 06:43:18 PM »
SYSVDLG  -->  sysvdlg.arx


Ketxu

  • Newt
  • Posts: 109
Re: Generating a log file of sysvars for the open drawing?
« Reply #7 on: November 15, 2011, 10:49:04 PM »
But using the SET command doesn't work from lisp.
You can use
(vla-sendcommand (vla-get-activedocument(vlax-get-acad-object)) "set\n?\n*\n")
instead of (command "SET" "?" "*")

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Generating a log file of sysvars for the open drawing?
« Reply #8 on: November 15, 2011, 10:51:53 PM »
But using the SET command doesn't work from lisp.
You can use
(vla-sendcommand (vla-get-activedocument(vlax-get-acad-object)) "set\n?\n*\n")
instead of (command "SET" "?" "*")
or just repalce "SET" with "SETVAR" (the actual command name - not alias).

SET is the command alias for SETVAR.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

danallen

  • Guest
Re: Generating a log file of sysvars for the open drawing?
« Reply #9 on: November 15, 2011, 10:57:17 PM »
SET is the command alias for SETVAR.

Not true, SET can be used with read to create symbol names based on other variables.
Code: [Select]
(set (read "a") 5.0)
is the same as
Code: [Select]
(setq a 5.0)except that "a" could be replaced with (strcat "a" yourvariable)

or for a full function:

Code: [Select]
;==========================================================
; SETV function saves setvar settings to be reset at end with RSETV
;     (setv "cmdecho" 0) set cmdecho off
;     (rsetv "cmdecho")  resets cmdecho (see below)
;   taken from Essential AutoLISP by Roy Harkow
;==========================================================
(defun-q SETV (sysvar newval / cmdnam)
  (setq cmdnam (read (strcat sysvar "1"))) ;Create   [savevar]1
  (set cmdnam (getvar sysvar)) ;Save     [savevar]'s value
  (setvar sysvar newval) ;Then set [savevar] to new value
)

(defun-q RSETV (sysvar / )
  (if (eval (read (strcat sysvar "1"))) ;Only change if exists
    (progn
      (setq cmdnam (read (strcat sysvar "1"))) ;Create   [savevar]1
      (setvar sysvar (eval cmdnam)) ;Restore  [savevar]'s value
      (set cmdnam nil)
    ) ;end progn
  ) ;end if
)


alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Generating a log file of sysvars for the open drawing?
« Reply #10 on: November 15, 2011, 11:04:31 PM »
SET is the command alias for SETVAR.

Not true, SET can be used with read to create symbol names based on other variables.
Code: [Select]
(set (read "a") 5.0)
I know, but it's also the default command alias for the setvar command, which is what the op was intending to call. For his function to work, he just needed to replace "SET" with "SETVAR" This has nothing to do with the set function.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Ketxu

  • Newt
  • Posts: 109
Re: Generating a log file of sysvars for the open drawing?
« Reply #11 on: November 16, 2011, 01:11:57 AM »


SET is the command alias for SETVAR.

yes, i think so too, i just post another way to call sth else  based on sencommand method ^^

KewlToyZ

  • Guest
Re: Generating a log file of sysvars for the open drawing?
« Reply #12 on: November 16, 2011, 03:37:19 PM »
Is there a way to get through the prompts for hit any key?
I was trying the Expert variable but the only references I have are:
;EXPERT - Controls whether certain prompts are issued.
;0 Issues all prompts normally.
;1 Suppresses "About to regen, proceed?" and "Really want to turn the current layer off?"
;2 Suppresses the preceding prompts and "Block already defined. Redefine it?"
;   (BLOCK) and "A drawing with this name already exists. Overwrite it?" (SAVE or WBLOCK).
;3 Suppresses the preceding prompts and those issued by the LINETYPE command if you try to load a linetype
;   that’s already loaded or create a new linetype in a file that already defines that linetype.
;4 Suppresses the preceding prompts and those issued by UCS Save and VPORTS Save if the name you supply already exists.
;5 Suppresses the prompt, "That name is already in Use, redefine it?"
;   issued by the -DIMSTYLE Save option when you supply the name of an existing dimension style.
Any feedback appreciated. VARS2SCR isn't really what I was looking for.