Code Red > AutoLISP (Vanilla / Visual)
Purge & Audit
rugaroo:
Is there a way to hide the purge and audit processes when you use the -purge / -audit commands?
JohnK:
I dont really understand what your looking for but...
Here is how you purge your drawing via Visual Lisp.
(vla-PurgeAll (vla-get-ActiveDocument (vlax-get-object "AutoCAD.Application")))
I'm not sure about this, but this is how you Audit in Visual Lisp. (This is kinda weird)
(vla-AuditInfo (vla-get-ActiveDocument (vlax-get-object "AutoCAD.Application")) :Vlax-True)
Other then that, you could be looking for the "cmdecho" variable. 1 = dispays all and 0 = dosent display anything.
Here run both of this lisps and youll see what I mean.
--- Code: ---(defun c:line1 ()
(command "line" (getpoint (setq x (getpoint "\nEnter First point: ")) "\nEnter second Point: ") x "")
(princ)
)
--- End code ---
--- Code: ---(defun c:line2 ()
(setvar "cmdecho" 0)
(command "line" (getpoint (setq x (getpoint "\nEnter First point: ")) "\nEnter second Point: ") x "")
(setvar "cmdecho" 1)
(princ)
)
--- End code ---
Does that help?
rugaroo:
SWWWWWEEEET...that is exactly what I was looking to have done...but is there a way I could do that with lisp? If not, I guess I just have to live without it :).
Rug
Mark:
Like this maybe.
--- Code: ---(defun c:PurgeAudit ( / *doc*)
(setq *doc* (vla-get-ActiveDocument (vlax-get-acad-object)))
(prompt "\nAbout to Audit Drawing")
(vla-AuditInfo *doc* :vlax-true)
(prompt "\nDone........")
(prompt "\nAbout to Purge All")
(vla-PurgeAll *doc*)
(prompt "\nDone........")
(princ)
)
--- End code ---
rugaroo:
Not like that Mark...Sorry if I wasn't clear enough. But like if you set cmdecho to 0, certain things are hidden from the command line, but when you do something like this.
--- Code: ---(defun c:purge1 ()
(setvar "cmdecho" 0)
(vl-cmdf "purge" "*" "all")
(princ)
--- End code ---
You still see the progress of what is being done...I didn't know if there was some other way than what you and 7 have posted.
Rug
Navigation
[0] Message Index
[#] Next page
Go to full version