ObjectDBX and check if PROXYGRAPHICS = 1

ObjectDBX and check if PROXYGRAPHICS = 1

mdhutchinson
Advisor Advisor
285 Views
1 Reply
Message 1 of 2

ObjectDBX and check if PROXYGRAPHICS = 1

mdhutchinson
Advisor
Advisor

I need some quick code... can someone assist?

I'd like to check if certain dwgs have been saved with PROXYGRAPHICS. Help says this setting is saved in the drawing.

 

 

(getvar "PROXYGRAPHICS")

0 Likes
286 Views
1 Reply
Reply (1)
Message 2 of 2

hmsilva
Mentor
Mentor

With ObjectDBX, we can't access to System Variables...

 

Not fast, but perhaps something like this.

 

;; usage
;; (get_prox "C:\\some\\path\\")
(defun get_prox (path / dwg dwg_lst lst val)
  (if (and (findfile (vl-string-right-trim "\\" path))
           (setq dwg_lst (vl-directory-files path "*.dwg"))
      )
    (progn
      (foreach x (vl-directory-files path "*.dwg")
        (setq dwg (vla-open (vla-get-documents (vlax-get-acad-object)) (strcat "\"" path x "\"") :vlax-true))
        (if (/= (setq val (vlax-variant-value (vla-getvariable dwg "PROXYGRAPHICS"))) 1)
          (setq lst (cons (list x (itoa val)) lst))
        )
        (vla-close dwg :vlax-false)
      )
      (if lst
        (princ lst)
        (princ "\nAll dwgs with PROXYGRAPHICS = 0... ")
      )
    )
  )
  (princ)
)

 

Hope this helps,
Henrique

EESignature

0 Likes