Results 1 to 4 of 4

Thread: Set up default settings for the Event Viewer in a Template?

  1. #1
    I could stop if I wanted to
    Join Date
    2015-05
    Location
    West Des Moines
    Posts
    252
    Login to Give a bone
    0

    Question Set up default settings for the Event Viewer in a Template?

    Is there a way to set up default settings for the event viewer in a template? I am aware you can turn the event viewer on or off in the template, but recently discovered you can tell it not to show specific events like information alerts. I would like this to be the default in the template, but when I make the change, save the template, and start a new drawing it does not save that setting. Looked in drawing settings to see if there were more options, but I only find the option for suppressing it completely or not.

    Thanks

    Edit: Hm, now that I am playing around more with the event viewer the filter option doesn't seem to work the way I would think it does. Clearing events seems to reset the filter properties so I start seeing information events pop up again? Because that's annoying.
    Last edited by CCarleton; 2018-11-27 at 07:07 PM.

  2. #2
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,383
    Login to Give a bone
    0

    Default Re: Set up default settings for the Event Viewer in a Template?

    I'm not aware of a way to configure Event Viewer so that those settings/filters persist, but you can disable it altogether:

    Code:
    (vl-load-com)
    
    (defun c:DisableEventViewer ( / *error* _IsCivilDatabase vrsn acApp aeccApp show)
    
      (defun *error* (msg)
        (if aeccApp
          (vlax-release-object aeccApp)
        )
        (if acDoc
          (vla-endundomark acDoc)
        )
        (cond ((not msg))                                                   ; Normal exit
              ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
              ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
        )
        (princ)
      )
    
      (defun _IsCivilDatabase (/ isCivilDb)
        ;; Example:
        ;; (if (_IsCivilDatabase)
        ;;   (prompt "\nCivil 3D Drawing opened. ")
        ;; )
        (foreach x (entget (namedobjdict))
          (if (and (= 3 (car x)) (= "Root" (cdr x)))
            (setq isCivilDb T)
          )
        )
        isCivilDb
      )
    
      (if
        (and
          (_IsCivilDatabase)
          (setq vrsn (getvar 'acadver))
          (setq vrsn
                 (cond
                   ((vl-string-search "23.0" vrsn) "13.0")                  ; 2019
                   ((vl-string-search "22.0" vrsn) "12.0")                  ; 2018
                   ((vl-string-search "21.0" vrsn) "11.0")                  ; 2017
                   ((vl-string-search "20.1" vrsn) "10.5")                  ; 2016
                   ((vl-string-search "20.0" vrsn) "10.4")                  ; 2015
                   ((vl-string-search "19.1" vrsn) "10.3")                  ; 2014
                   ((vl-string-search "19.0" vrsn) "10.0")                  ; 2013
                   ((vl-string-search "18.2" vrsn) "9.0")                   ; 2012
                   ((vl-string-search "18.1" vrsn) "8.0")                   ; 2011
                   ((vl-string-search "18.0" vrsn) "7.0")                   ; 2010
                   ((vl-string-search "17.2" vrsn) "6.0")                   ; 2009
                   ((vl-string-search "17.1" vrsn) "5.0")                   ; 2008
                   (T nil)
                 )
          )
          (setq aeccApp (vla-getinterfaceobject
                          (setq acApp (vlax-get-acad-object))
                          (strcat
                            "AeccXUiLand.AeccApplication."
                            vrsn
                          )
                        )
          )
          (= -1
             (vlax-get
               (setq show
                      (vlax-get
                        (vlax-get
                          (vlax-get
                            (vlax-get
                              (vlax-get (vlax-get aeccApp 'ActiveDocument)
                                        'Settings
                              )
                              'DrawingSettings
                            )
                            'AmbientSettings
                          )
                          'GeneralSettings
                        )
                        'ShowEventViewer
                      )
               )
               'Value
             )
          )
          (princ "\nDisabling Event Viewer... ")
          (princ)
        )
         (progn
           (vla-startundomark
             (setq acDoc (vla-get-activedocument acApp))
           )
           (vlax-put show 'Value 0)
           (princ "Done. \n")
         )
         (cond
           ((not vrsn)
            (prompt "\n** Not a Civil 3D Drawing ** \n")
           )
           (vrsn
            (prompt
              "\n** Unable to interface with \"AeccXUiLand.AeccApplication\" object ** \n"
            )
           )
           (show
             (prompt "\nEvent Viewer already disabled. \n")
           )
         )
      )
    
      (*error* nil)
    )
    Last edited by BlackBox; 2018-11-27 at 08:13 PM.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 32GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    I could stop if I wanted to
    Join Date
    2015-05
    Location
    West Des Moines
    Posts
    252
    Login to Give a bone
    0

    Default Re: Set up default settings for the Event Viewer in a Template?

    Ugh, I somehow lost my reply. To keep it short and sweet:

    -Don't want to disable it permanently, and you can do that in CAD drawing settings anyways
    -As someone who builds the initial surfaces off of topo surveys I feel the event viewer being on is crucial because it alerts you to overlapping breaklines which allows you to address them.
    -What I wanted to achieve was an event viewer that only ever populated errors and warnings. Information alerts are numerous, unnecessary, and therefore annoying, especially by the time you're done cleaning up the breaklines and they share a common point.

    All I do right now is turn the event viewer off for the topo before I deliver it to the engineer. If I could get the event viewer to not show information alerts I'd leave it on all the time. I wasn't holding my breath for being able to do that though, but figured I'd see if anyone smarter knew how.

    Thanks

  4. #4
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,383
    Login to Give a bone
    0

    Default Re: Set up default settings for the Event Viewer in a Template?

    AFAIK, there is no way to configure Event Viewer and have those settings/filters persist... Which sucks.

    The above code does the same thing as you manually setting Toolspace, Settings tab, Drawing Settings, Ambient Settings, General, 'Show Event Viewer' == No... Just a lot faster and allows you to batch process drawings (via Script, otherwise .NET is needed; C3D's Batch Save Utility doesn't support Visual LISP calls), since this is a drawing-saved setting.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 32GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. 2017: Event Viewer
    By tim_newsome in forum AutoCAD Civil 3D - General
    Replies: 2
    Last Post: 2017-06-06, 05:26 PM
  2. 2016: Corridor Event Viewer
    By tim_newsome in forum AutoCAD Civil 3D - Corridors
    Replies: 4
    Last Post: 2016-02-16, 08:06 PM
  3. Event Viewer
    By clarkl in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2011-11-04, 03:45 PM
  4. Replies: 0
    Last Post: 2011-10-24, 03:59 PM
  5. Project Template and Default Settings
    By rdh4176 in forum Green Building Studio - General
    Replies: 0
    Last Post: 2009-12-02, 09:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •