TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rugaroo on September 28, 2003, 07:27:47 PM
-
Is there a way to hide the purge and audit processes when you use the -purge / -audit commands?
-
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.
(defun c:line1 ()
(command "line" (getpoint (setq x (getpoint "\nEnter First point: ")) "\nEnter second Point: ") x "")
(princ)
)
(defun c:line2 ()
(setvar "cmdecho" 0)
(command "line" (getpoint (setq x (getpoint "\nEnter First point: ")) "\nEnter second Point: ") x "")
(setvar "cmdecho" 1)
(princ)
)
Does that help?
-
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
-
Like this maybe.
(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)
)
-
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.
(defun c:purge1 ()
(setvar "cmdecho" 0)
(vl-cmdf "purge" "*" "all")
(princ)
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
-
Why are you so intent on hiding the output from the user? Just curious. <g>
-
I just hate seeing the long list of stuff when I do a purge. I know it sounds wierd, but I am just trying to eliminate some time by removing the displays of certain commands that tend to take a bit too long. But I will have to live with the vla stuff that you and 7 posted...all well...still does what I was looking for, just in a different way.
Rug
-
Like this maybe.
(defun c:PurgeAudit ( / *doc*)
(setq *doc* (vla-get-ActiveDocument (vlax-get-acad-object)))
(vla-AuditInfo *doc* :vlax-true)
(vla-PurgeAll *doc*)
(princ)
)
Wouldn't this aleviate all prompts and knowledge that anything actually happened?
-
Yeah it does...I just didn't know if there was some possible way to get around it without going to vla...It works just fine though.
-
There is a variable, but it's awful. Don't use it. It's called, "nomutt". It means "No Mutterance".
-
Don't worry...Just by the sound of it, that is an evil command...anyways, I tried what 7 had posted at home last night, and it went through cleanly with out displaing any info at all. This morning when I come into work I used the following, and the purge does not display but the audit does....any ideas...?
(DEFUN c:Pal2 ()
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
:VLAX-TRUE
)
(PROMPT "\nPurginging your drawing.")
(VLA-PURGEALL
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
)
(PROMPT "\nRepeating process three times...")
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
:VLAX-TRUE
)
(VLA-PURGEALL
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
)
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
:VLAX-TRUE
)
(VLA-PURGEALL
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
)
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
:VLAX-TRUE
)
(VLA-PURGEALL
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT "AutoCAD.Application")
)
)
(setvar "cmdecho" cmd)
(PRINC)
)
-
Could it be the way he gets the acad application? I don't know. I also toned it down a bit. Repeat is good for this function. Let us know if this works.
Don't worry...Just by the sound of it, that is an evil command...anyways, I tried what 7 had posted at home last night, and it went through cleanly with out displaing any info at all. This morning when I come into work I used the following, and the purge does not display but the audit does....any ideas...?
(DEFUN c:Pal2 ()
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-OBJECT)
)
:VLAX-TRUE
)
(PROMPT "\nPurginging your drawing.")
(repeat 3
(VLA-PURGEALL
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-ACAD-OBJECT)
)
)
(VLA-AUDITINFO
(VLA-GET-ACTIVEDOCUMENT
(VLAX-GET-ACAD-OBJECT)
)
:VLAX-TRUE
)
)
)
(PROMPT "\nProcess repeated three times...")
(setvar "cmdecho" cmd)
(PRINC)
)
-
Yours comes up with too few arguments...So that is going to be because of the "AutoCAD.Application" I take it...hmmmm
-
Sort of. It's because I forgot to add acad in the first auditinfo. Also, because there were too many closing parenthesis when I built the repeat. That's what I get for not writing in an editor or testing. Here's an even cleaner version:
(DEFUN c:Pal2 (/ cmd $doc aud)
(setq cmd (getvar "cmdecho")
$doc (vla-get-activedocument (vlax-get-acad-object))
)
(setvar "cmdecho" 0)
(setq aud (VLA-AUDITINFO $doc :VLAX-TRUE))
(PROMPT "\nPurginging your drawing.")
(repeat 3
(VLA-PURGEALL $doc)
aud
)
(PROMPT "\nProcess repeated three times...")
(setvar "cmdecho" cmd)
(PRINC)
)
-
Well, you got rid of all of the Audits except for one...the first one. Is there any way to hide this too?
Also, I noticed that it works just fine if you replace :VLAX-TRUE with just plain old T...why would that be? I will keep the vlax-true, but I was just playing around and saw that.
Rug
-
Because they both mean the same thing. T
-
I understand that they are both the same, but when using VL commands, why would you have limited abilities as to which arguements you can use. In other words, if you wanted to use a T staement with lisp, you just are able to use T, and vice versa with the :VLAXtrue. You see what I am saying...this was just a minor observation.