See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Automate SETNETWORKCATALOG value for multiple client standards for Civil 3D

  1. #1
    Active Member nelson's Avatar
    Join Date
    2015-11
    Location
    Portland, MI
    Posts
    90
    Login to Give a bone
    0

    Default Automate SETNETWORKCATALOG value for multiple client standards for Civil 3D

    Does anyone know if it's possible (lisp, .Net) to automate the location and values of SETNETWORKCATALOG variable for Civil 3D?

    This might be second post\thread, but does anyone know or recommend any resources to easily setup multiple CAD Standards for Civil 3D?

    Outside of the normal Civil 3D template files and profile (*.arg) I was looking for a way to put some sort of ini file in the project working folder and have code read through that and set paths for certain support files. (Pipe Catalog location, plotter, symbols, other support files) I have 4 Client's standards (Civil 3D) that all need to be implemented in the next 4 weeks. Thought I could do something with acaddoc.lsp or acad.lsp but Pipe catalog location, among other settings, are not configurable here.

  2. #2
    Super Moderator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,671
    Login to Give a bone
    1

    Default Re: Automate SETNETWORKCATALOG value for multiple client standards for Civil 3D

    #1 - See https://forums.autodesk.com/t5/civil...g/td-p/5523188

    #2 - Yes, in general, you set up an "acad.lsp" (for things needed set once per *session*) and "acaddoc.lsp" (for things needed set once per *drawing*), in a central location.
    * Then you plant a "seed" "acad.lsp" in the default support folder. For example: C:\Program Files\Autodesk\AutoCAD 2019\Support.
    * Then when any user fires up C3D/ACAD - it will load this "seed" "acad.lsp", which does nothing but in turn load your network version, which does all of the work.
    * Your network "Acad.lsp" should also set the support paths, making its own location at the top of the paths.
    * Then all future launches will skip the "seed" "Acad.lsp" and simply load and execute the network "Acad.lsp".
    * and from that point on, you can centrally control what happens on all PCs by editing those two files.

    P.S. - yes, you can set the pipe catalog location in the network "acad.lsp"
    and yes you can do multiple standards with some creative thinking. For example, you could have an IF statement in your "acad.lsp" that says (pseudo code) If user = Joe, then do this. If user = Kim, then do this, and so on. You could make changes based on the drawing folder, or any number of things.
    R.K. McSwain | CAD Panacea |

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

    Default Re: Automate SETNETWORKCATALOG value for multiple client standards for Civil 3D

    Steve's code was very helpful; thanks for the link, RK.

    Here's a simplified adaptation, that makes it easy to quickly switch between & setup new client standards:

    Code:
    (vl-load-com)
    
    (defun c:SetClient1Catalog  (/ folder)
    
      (setq folder "X:\\Client1\\Pipes Catalog")
      
      (_SetNetworkCatalog
             (list
               ;; imperial pipes
               (cons
                 "16C49365-B844-484b-92CE-9A8ACE681B57"                      ;<-- this guid could change in future versions
                 (strcat folder
                         "\\US Imperial Structures\\US Imperial Pipes.apc"
                 )
               )
                ;; imperial structures
                (cons
                  "DCE203A2-D381-466f-A23E-08A9D9F8FDBD"                     ;<-- this guid could change in future versions
                  (strcat
                    folder
                    "\\US Imperial Structures\\US Imperial Structures.apc"
                  )
                )
                ;; metric pipes
                (cons
                  "F670B5B9-DA12-476d-B461-4FB5C5650A82"                     ;<-- this guid could change in future versions
                  (strcat folder "\\Metric Pipes\\Metric Pipes.apc")
                )
                ;; metric structures
                (cons
                  "F1FEBE2D-D589-4f85-BF8E-650ED06A5EA5"                     ;<-- this guid could change in future versions
                  (strcat
                    folder
                    "\\Metric Structures.apc\\Metric Structures.apc"
                  )
                )
                ;; shared content
                (cons
                  "SharedContentPath"
                  (strcat folder "\\Aecc Shared Content")
                )
              )
      ) 
    
      (princ)
    )
    ;;;--------------------------------------------------------------------;
    (defun c:SetDefaultCatalog  (/ folder)
      
      (setq folder "C:\\ProgramData\\Autodesk\\C3D 2019\\enu\\Pipes Catalog")
      
      (_SetNetworkCatalog
             (list
               ;; imperial pipes
               (cons
                 "16C49365-B844-484b-92CE-9A8ACE681B57"                      ;<-- this guid could change in future versions
                 (strcat folder
                         "\\US Imperial Structures\\US Imperial Pipes.apc"
                 )
               )
                ;; imperial structures
                (cons
                  "DCE203A2-D381-466f-A23E-08A9D9F8FDBD"                     ;<-- this guid could change in future versions
                  (strcat
                    folder
                    "\\US Imperial Structures\\US Imperial Structures.apc"
                  )
                )
                ;; metric pipes
                (cons
                  "F670B5B9-DA12-476d-B461-4FB5C5650A82"                     ;<-- this guid could change in future versions
                  (strcat folder "\\Metric Pipes\\Metric Pipes.apc")
                )
                ;; metric structures
                (cons
                  "F1FEBE2D-D589-4f85-BF8E-650ED06A5EA5"                     ;<-- this guid could change in future versions
                  (strcat
                    folder
                    "\\Metric Structures.apc\\Metric Structures.apc"
                  )
                )
                ;; shared content
                (cons
                  "SharedContentPath"
                  (strcat folder "\\Aecc Shared Content")
                )
              )
      ) 
    
      (princ)
    )
    ;;;--------------------------------------------------------------------;
    (defun _SetNetworkCatalog (catalog / reg key val)
      (foreach x (vl-registry-descendents
                     (setq reg
                            (strcat
                              "HKEY_CURRENT_USER\\"
                              (if vlax-user-product-key                     ; If 2013+
                                (vlax-user-product-key)                     ; Use 2013 function
                                (vlax-product-key)                          ; Use legacy function
                              )
                              "\\Profiles\\"
                              (getvar 'cprofile)
                              "\\Preferences"
                            )
                     )
                   )
        (if (vl-string-search "AeccUiNetwork" x)
          (foreach item catalog
            (setq val (car item))
            (if (vl-registry-read (setq key (strcat reg "\\" x)) val)
              (vl-registry-write key val (cdr item))
            )
          )
        )
      )
    )
    
    (princ)
    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, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. CM31-1: Help! I Have to Use the Client's CAD Standards
    By Autodesk University in forum CAD Management
    Replies: 0
    Last Post: 2012-11-24, 07:38 PM
  2. MG33-2: Help! I Have to Use a Client's Standards How to Protect Yourself
    By Autodesk University in forum CAD Management
    Replies: 0
    Last Post: 2012-11-19, 03:44 PM
  3. Civil Standards
    By tladams10 in forum Land Desktop - General
    Replies: 3
    Last Post: 2008-03-04, 09:37 PM
  4. Civil 3D 2007 - How does file structure and standards relate to Civil 3D
    By eleonard in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2007-01-22, 06:05 AM
  5. Best way to document Client and Company CAD Standards
    By avdesign in forum CAD Standards
    Replies: 5
    Last Post: 2006-07-12, 08:18 PM

Tags for this Thread

Posting Permissions

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