Author Topic: Silent Purge  (Read 6529 times)

0 Members and 1 Guest are viewing this topic.

CADaver

  • Guest
Silent Purge
« on: June 17, 2005, 10:48:32 AM »
I want to automatically purge SOME stuff (I sorta know about vla-purgeall), not everything.  Anyway, I hobbled together a routine using  (command "-purge" and works fine EXCEPT it echos whats being purged to the screen (even when CMDECHO is off). <see below>  Is there some way to so this silently?  Or some other way entirely, that will "auto" purge specific stuff without kicking up a fuss?

    Deleting dimension style "dim120".
    Deleting dimension style "Standard".
    2 dimension styles deleted.
    Deleting linetype "HANDRAIL".
    Deleting linetype "MATCHLINE".
    Deleting linetype "REBAR-01".
    Deleting linetype "REBAR02".
    Deleting linetype "REBAR04".
    Deleting linetype "REBAR05".
    Deleting linetype "TOPLINE23".
    7 linetypes deleted.
    Deleting plotstyle "ByLayer".
    Deleting plotstyle "Extra Thin".
    Deleting plotstyle "Medium".
    Deleting plotstyle "Style_1".
    Deleting plotstyle "Style_2".
    Deleting plotstyle "Style_3".
    Deleting plotstyle "Style_4".
    7 plotstyles deleted.
    Deleting text style "btxt120".
    Deleting text style "btxt240".
    Deleting text style "Dimn".
    Deleting text style "txt120".
    4 text styles deleted.
    Deleting shape file "ltypeshp.shx".
    1 shape file deleted.
    [/list:u]

    daron

    • Guest
    Silent Purge
    « Reply #1 on: June 17, 2005, 10:57:42 AM »
    Purge all and save. Currently set to purge four times. You can set it to whatever you desire.
    Code: [Select]
    ;;;=====================================================================;
    ;;;Purgeall and save ;
    ;;;=====================================================================;
    (defun c:purgesave (/ $acad $doc)
         (setq $doc (vla-get-activedocument (vlax-get-acad-object)))
         (repeat 4
     (vla-purgeall $doc)
         )
         (vla-save $doc)
         (vlax-release-object $doc)
         (princ
     "\nDrawing has been completely purged and successfully saved. "
         )
         (princ)
    )
    You can also remove the vla-save if you don't wish to autosave.

    MP

    • Seagull
    • Posts: 17750
    • Have thousands of dwgs to process? Contact me.
    Silent Purge
    « Reply #2 on: June 17, 2005, 10:57:44 AM »
    I don't think so Randy. I don't think qaflags will stifle it either. You'd probably have to hand roll some arx.
    Engineering Technologist CAD Automation Practitioner
    Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
    cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

    daron

    • Guest
    Silent Purge
    « Reply #3 on: June 17, 2005, 10:58:56 AM »
    Will mine do it? I've never had a problem. Did I not understand the question?

    MP

    • Seagull
    • Posts: 17750
    • Have thousands of dwgs to process? Contact me.
    Silent Purge
    « Reply #4 on: June 17, 2005, 10:59:49 AM »
    Quote from: daron
    Purge all and save. Currently set to purge four times. You can set it to whatever you desire ... <snip> ...You can also remove the vla-save if you don't wish to autosave.

    Umm:
    Quote from: Randy
    I want to automatically purge SOME stuff (I sorta know about vla-purgeall), not everything.
    Engineering Technologist CAD Automation Practitioner
    Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
    cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

    CADaver

    • Guest
    Silent Purge
    « Reply #5 on: June 17, 2005, 11:02:49 AM »
    Quote from: MP
    I don't think so Randy. I don't think qaflags will stifle it either. You'd probably have to hand roll some arx.
    I played with qaflags a little but didn't see a way around it there.  Looks like I'll live with the echo for a while.

    Daron, I just want to purge SOME stuff, not all.  I have a function (surprisingly similar to yours) that does a purge ALL, but I don't want to purge Blocks and Layers, just everything else.

    MP

    • Seagull
    • Posts: 17750
    • Have thousands of dwgs to process? Contact me.
    Silent Purge
    « Reply #6 on: June 17, 2005, 11:06:27 AM »
    A cludgy work around would be to make a reference to anything you do wish to keep (that is currently not referenced), say a block def, a layer or a text style, do a vla-purgeall, then delete the temporary references. Would require a fair bit of coding, albeit mostly trivial.
    Engineering Technologist CAD Automation Practitioner
    Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
    cadanalyst@gmail.com http://cadanalyst.slack.com http://linkedin.com/in/cadanalyst

    daron

    • Guest
    Silent Purge
    « Reply #7 on: June 17, 2005, 11:07:02 AM »
    Quote from: MP
    Quote from: daron
    Purge all and save. Currently set to purge four times. You can set it to whatever you desire ... <snip> ...You can also remove the vla-save if you don't wish to autosave.

    Umm:
    Quote from: Randy
    I want to automatically purge SOME stuff (I sorta know about vla-purgeall), not everything.


    Saw that. Didn't read well to me. Heh. I don't even use mine anymore because if I purge any blocks or layers it kills the whole program I have to use. Poor scripting. example: "layer" "s"...:?: Grrr.

    CADaver

    • Guest
    Silent Purge
    « Reply #8 on: June 17, 2005, 11:41:31 AM »
    Quote from: MP
    Would require a fair bit of coding, albeit mostly trivial.
    ummm... I can live with the echos, just hoping for an "Easy Button".

    CADaver

    • Guest
    Silent Purge
    « Reply #9 on: June 17, 2005, 11:50:46 AM »
    BTW, Daron, I have one from D.M. Stien's Visual Lisp Bibile.

    Jeff_M

    • King Gator
    • Posts: 4093
    • C3D user & customizer
    Silent Purge
    « Reply #10 on: June 17, 2005, 12:59:40 PM »
    Randy, will this work for ya? I wasn't able to determine where the Shape file info is stored......
    Code: [Select]

    (defun c:cpurge (/ doc)
      (setq doc (vla-get-activedocument (vlax-get-acad-object)))
      (mapcar '(lambda (col)
        (vlax-for x col
          (vl-catch-all-apply 'vla-delete (list x))
          )
        )
     (list (vla-get-dimstyles doc) (vla-get-linetypes doc)
    (vla-get-textstyles doc) (vla-get-plotconfigurations doc)
    )
     )
      (princ)
      )

    whdjr

    • Guest
    Silent Purge
    « Reply #11 on: June 17, 2005, 01:12:54 PM »
    Schweeeeet!!

    Although you left out Layers and Blocks!

    Very Cool Jeff!!!

    I likes alot! :D  :D  :D  
    :dood:  :dood:  :dood:

    Jeff_M

    • King Gator
    • Posts: 4093
    • C3D user & customizer
    Silent Purge
    « Reply #12 on: June 17, 2005, 02:47:51 PM »
    Quote from: whdjr

    Although you left out Layers and Blocks!

    Very Cool Jeff!!!
    Thanks!
    As for leaving things out.......
    Quote from: CADaver
    .... but I don't want to purge Blocks and Layers, just everything else.


     8)

    whdjr

    • Guest
    Silent Purge
    « Reply #13 on: June 17, 2005, 02:50:09 PM »
    :?

    sorry

    CADaver

    • Guest
    Silent Purge
    « Reply #14 on: June 17, 2005, 04:22:29 PM »
    That's pretty cool, thanks, but it's not getting rid of PLOTSTYLES that can be PURGEd.  
    Any ideas?