Author Topic: Purge & Audit  (Read 9001 times)

0 Members and 1 Guest are viewing this topic.

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« 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?
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9195
Purge & Audit
« Reply #1 on: September 29, 2003, 01:41:37 PM »
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: [Select]
(defun c:line1 ()
  (command "line" (getpoint (setq x (getpoint "\nEnter First point: ")) "\nEnter second Point: ") x "")
 (princ)
)


Code: [Select]
(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?
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #2 on: September 30, 2003, 09:43:46 PM »
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
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28673
Purge & Audit
« Reply #3 on: October 01, 2003, 02:26:33 AM »
Like this maybe.
Code: [Select]
(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)
    )
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #4 on: October 01, 2003, 08:55:54 AM »
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: [Select]
(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
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

Mark

  • Custom Title
  • Seagull
  • Posts: 28673
Purge & Audit
« Reply #5 on: October 01, 2003, 09:23:05 AM »
Why are you so intent on hiding the output from the user? Just curious. <g>
TheSwamp.org  (serving the CAD community since 2003)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #6 on: October 01, 2003, 10:07:05 AM »
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
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

daron

  • Guest
Purge & Audit
« Reply #7 on: October 01, 2003, 10:15:25 AM »
Quote from: Mark Thomas
Like this maybe.
Code: [Select]
(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?

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #8 on: October 01, 2003, 10:27:46 AM »
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.
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

daron

  • Guest
Purge & Audit
« Reply #9 on: October 01, 2003, 10:38:24 AM »
There is a variable, but it's awful. Don't use it. It's called, "nomutt". It means "No Mutterance".

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #10 on: October 01, 2003, 10:57:09 AM »
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...?

Code: [Select]
(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)
)
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

daron

  • Guest
Purge & Audit
« Reply #11 on: October 01, 2003, 11:05:55 AM »
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.
Quote from: rugaroo
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...?

Code: [Select]
(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)
)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #12 on: October 01, 2003, 11:21:33 AM »
Yours comes up with too few arguments...So that is going to be because of the "AutoCAD.Application" I take it...hmmmm
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017

daron

  • Guest
Purge & Audit
« Reply #13 on: October 01, 2003, 12:00:14 PM »
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:
Code: [Select]
(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)
)

rugaroo

  • Bull Frog
  • Posts: 378
  • The Other CAD Guy
Purge & Audit
« Reply #14 on: October 03, 2003, 02:46:16 PM »
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
LDD06-09 | C3D 04-19 | Infraworks 360 | VS2012-VS2017