Networked CAD Management Part 1: Support folder, acad.lsp, and acaddoc.lsp.

pic11.png

   

 

     CAT Management.png

 

 

 Intro

    Managing a group of people, or in this case, machines used by people, undoubtedly comes with challenges unique to the type of work being performed. Consistency with standards and supporting documents foster an environment that allows for greater focus to be paid to the quality and correctness of the work. Providing a foundation for production within the CAD environment reduces rework and enhances the user’s experience. These ideas, when supported and enforced, provide faster onboarding, a better product, a stable environment, and ad-hoc teams in an agile workforce.

 

     Bringing this vision of a perfect environment within one office with few users is viable. Applying the same vision across a dispersed workforce in multiple locations with regional specifics is a moonshot, to say the least. In the imperfect setting, perfection comes a little differently. Both scenarios are always evolving, but with different milestones and goals. Methods that work in a small office will break an enterprise. Foundations in the enterprise are not cost-efficient in the small business.

 

     I submit, for your consideration, a detailed account of the means and methods that I have discovered and put in place over the last 20 years in CAD management roles. This series of articles will cover a vast assortment of topics. None of this could have been realized without the assistance and generosity of countless people and the companies that have supported me as non-billable knowing that the benefits outweigh the cost. @ToddRogers-WPM has been an invaluable sounding board over the years, and I’m honored to call him a friend and coworker. Angel Espinoza, the Bartel bros., Lynn Allen, James Maeding, and all the engineers and coworkers have influenced these decisions. And a thank you to the people that welcomed me to the world of civil engineering, Kelly and Marty Aguerre.

 

The support folder, acad.lsp, and acaddoc.lsp

 

     So we begin, with the installation and first run setup procedure of AutoCAD, Civil3D, or the like, on your shiny new computer or the new version year. I try to leave the installation as unmolested as possible, so there will be no profile, pgp, or cui edits. I will cover the way I integrate, and supercharge a new installation with three easy steps.

  1. Set the support folder path to a networked location and move that folder to the top of the list.
  2. Set the Pipe Catalog using the command SETNETWORKCATALOG to the networked location.
  3. Restart CAD TWICE.

Done! But now let us talk about how it is actually done, because there is a lot going on under the hood.

 

Really quick about LSP:

  • LSP or LISP files contain commands in a scripting program style that can accomplish almost anything special.
  • LISP is a very mature language and the original way of customizing AutoCAD behavior.
  • My method of using LSP in enforcing standards follows the idea that someone with limited programming experience should be able to understand and modify many of the files. This means that many of the LSP files I create could be greatly shortened but are intentionally repetitive for ease of reading. Some special things will require more advanced knowledge of LISP or external consulting.

     Opening the options dialogue box and the files tab will get you to where we begin the journey. At the top of mine, you will see I have S:\ACAD\Support, along with all the standard paths from the installation. I’ve added the path and moved it to the top, so the program looks there first. I have not edited or removed anything else in the options dialog.

01-01.png

     The support folders are locations where the program looks to find various files that make different parts of the program work. It also can contain some special files that control what gets loaded either once at program start-up (acad.lsp) or when opening each file (acaddoc.lsp).

 

     I start with a folder stored on the server named ACAD. This folder lives in a permission-protected location with additional and more restrictive permission set on a subfolder that will be discussed later. The other folders house files that will be discussed later in the series.

01-02.png

 

     The support folder is the one we are interested in today. Inside the support folder, I have placed linetypes, shp, and shx files. As well as some dll, ini, and other files from Civil3D versions where they were not broken. An example of a broken item, where placing the dll in a common location is beneficial, is the version of Civil3D where creating a data shortcut of pipes and structures did not respect the styles from the source drawing. I placed the C3DPipeNetworkRules.dll file in our support folder and the company was immune to bad behavior until an update was produced. Another instance was the 2 foot sumps in structures bug. IYKYK.

 

     But all of this is just gravy when you use the acad.lsp file to setup all your company standards. In the support folder lives my acad.lsp and acaddoc.lsp. Since they are in the first folder in the support folders list, they get loaded anytime the program looks for them.

 

     The contents of my acad.lsp set all the other support paths but only if they haven’t already been set. The IF statement checks the environment variable, and the variables $temp1 and $temp2 combine the output and apply the environment variable.

     For example:

  • Check if the path for the environment variable “PrinterConfigDir” is "S:\\ACAD\\Plotters"
  • If it is, do nothing and go to the next line
  • If it isn’t, set it to "S:\\ACAD\\Plotters"

Having the IF statement improves performance, because the program doesn’t change anything if it doesn’t need to.

 

 

 

 

 

 

 

 

 

 

(if (/=(getenv (setq $temp1 "PrinterConfigDir"))(setq $temp2 "S:\\ACAD\\Plotters"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "PrinterDescDir"))(setq $temp2 "S:\\ACAD\\Plotters"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "PrinterStyleSheetDir"))(setq $temp2 "S:\\ACAD\\Plotters"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "TemplatePath"))(setq $temp2 "S:\\ACAD\\Template\\"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "SheetSetTemplatePath"))(setq $temp2 "S:\\ACAD\\Template\\"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "QnewTemplate"))(setq $temp2 "S:\\ACAD\\Template\\CORE-Civil.dwt"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "AlternativePageSetUpsTemplate"))(setq $temp2 "S:\\ACAD\\Template\\CORE-Civil.dwt"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "ToolPalettePath"))(setq $temp2 "S:\\ACAD\\Toolpalette\\Tools\\Palettes\\;S:\\ACAD\\Toolpalette\\Core\\Palettes\\;C:\\ProgramData\\Autodesk\\ApplicationPlugins\\groundforce.bundle\\Contents\\Resources\\ToolPalette\\en-US"))(command "*_TOOLPALETTEPATH" "S:\\ACAD\\Toolpalette\\Tools\\Palettes\\;S:\\ACAD\\Toolpalette\\Core\\Palettes\\;C:\\ProgramData\\Autodesk\\ApplicationPlugins\\groundforce.bundle\\Contents\\Resources\\ToolPalette\\en-US"))
(if (/=(getenv (setq $temp1 "PlotSpoolerDirectory"))(setq $temp2 "C:\\0plot"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "Temp"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "TMP"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "TempDirectory"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "SaveFilePath"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getvar (setq $temp1 "Logfilepath"))(setq $temp2 "C:\\0scratch"))(setvar $temp1 $temp2))
(if (/=(getenv (setq $temp1 "XLOADPATH"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "MoveBak"))(setq $temp2 "C:\\0scratch"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "CmdHistLines"))(setq $temp2 "2048"))(setenv $temp1 $temp2))
(if (/=(getenv (setq $temp1 "DCTMAIN"))(setq $temp2 "ENU"))(setenv $temp1 $temp2))

 

 

 

 

 

 

 

 

 

 

 

 

     Now that all the plotters, tool palette, template, and temporary save paths have been set, we can look at some more exciting things. I place system options in the acad.lsp, things that only need to run on startup. Drawing and session options in go in acaddoc.lsp, and get loaded or checked each time a file is opened. Inside the acaddoc.lsp, I load lsp files that are used in the tool palette or the command line as well as some that ensure the 0 layer is thawed and white and some that reset most, or all, the system variables in autocad. That last feature is super powerful when you have a large workforce and don’t want them using a specific command or want to ensure things like “filedia” is always correct. We can use the acaddoc.lsp to rollout an automatic purge or audit on every file opened or change a variable like “USERI1” for some special functions. You can see that I comment out some lines, because I don’t want those to run unless there is a special need.

 

 

 

 

 

 

 

 

 

 

;;;;;;;;;;;;;Core Tool Palette Dependencies;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(load "S:\\ACAD\\Support\\Applications\\CC.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\COUNTPARK.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\FreezeXrefLayer.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\GoogleMapViewinCAD.lsp" "Failed to Load")
;(load "S:\\ACAD\\Support\\Applications\\INTERPOL.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\LABELPARK.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\LABELPKCURVE.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\LYRTODEMO.LSP" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\LYRTODEMOPHASETXT.LSP" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\REVCLOUDWPM.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\SQFT.lsp" "Failed to Load")
;;;;;;;;;;;;;;CORE LOADER;;;;;;;;;;;;;;;
(load "S:\\ACAD\\Support\\Applications\\CORECHECKER.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\COREDETAIL.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\COREFONTS.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\CORELAYERS.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\CORELT.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\CUSTOMLT.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\CORESHORTCUTS.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\COREAPPS.lsp" "Failed to Load")
(load "S:\\ACAD\\Support\\Applications\\HINT.lsp" "Failed to Load")
;;(load "S:\\Acad2020\\Infra\\ctp-programs")
;;;;;;;;;;;;;;System Variables;;;;;;;;;;
(load "S:\\ACAD\\Support\\Applications\\CORESysvar.lsp" "Failed to Load")
;(load "S:\\ACAD\\Support\\Applications\\Sysvar-RESET.lsp" "Failed to Load")

 

 

 

 

 

 

 

 

 

 

Goodies

 

     What you see is the backbone or root of the CORE standards in our company. These standards provide a unified environment so that everyone’s machine behaves the same. I have modified some standard keyboard shortcuts to provide better functionality but leave further customization to the user. I could enforce that the company uses a white paper background, or a 100 width crosshair, but people have opinions about that. Regional standards are supported in the tool palette and through more LISP files.

 

The custom keyboard shortcuts live in the CORESHORTCUTS.lsp file. They don’t require any more pgp file editing and they look like this:

 

 

 

 

 

 

 

 

 

 

(defun c:mm () (command"mleader") )
(defun c:rev () (command"reverse") )
(defun c:flp () (command"labelflip") )
(defun c:au () (command"audit" "y") )
(defun c:pe () (command"pedit" "m") )
(defun c:pp () (command"PLINE") )
(defun c:fr () (command"layfrz") )
(defun c:la () (command"-layer") )
(defun c:lp () (command"layer") )
(defun c:lo () (command"layoff") )
(defun c:loa () (command"layon") )
(defun c:qe () (command"qleader") )
(defun c:qa () (command"qlattach") )
(defun c:ee () (command"executetool") )
(defun c:t2m () (command"txt2mtxt") )
(defun c:da () (command"dimaligned") )
(defun c:de () (command"ddedit") )
(defun c:rb () (command"REBUILDSURFACE") )
(defun c:ie() (command"_AeccInsertFeatureElevPoint") )
(defun c:de() (command"_AeccDeleteFeatureElevPoint") )
(defun c:sl() (command"_ADDSURFACELABELS") )
(defun c:mb () (command"CONVERTLINEWORKTOMASKBLOCK") )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Standard Commands Load;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:fx () (command"audit" "y") (command"-purge" "r" "*" "n") (command"-purge" "a" "*" "n") (command"qsave") )
(defun c:fxs () (command"audit" "y") (command"-purge" "r" "*" "n") (command"-purge" "a" "*" "n") (command"qsave") (command"ltscale" "1") (command"dimtxt" "0.1") (command"msltscale" "1") (command"psltscale" "1") (command"dimscale" "1") )
(defun c:qp () (command"qpmode" "1") )
(defun c:qq () (command"qpmode" "0") )
(defun c:fcL () (command"audit" "y") (command"-purge" "r" "*" "n") (command"-purge" "a" "*" "n") (command"qsave") (command"close" "y") )
(defun c:fq () (command"audit" "y") (command"-purge" "r" "*" "n") (command"-purge" "a" "*" "n") (command"qsave") (command"quit" "y") )
(defun c:sa () (command"snapang") )
(defun c:cg () (command"cgslist") )
(defun c:i () (command"_ClassicInsert") )
(defun c:dn () (command"DIST") )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;BETTER DISTANCE TOOL WITH SLOPE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:di () (command"cgslist" "p") )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;VOLUME CALCULATIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:rs () (command"REPORTSURFACEVOLUME") )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;FEATURE LINES;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:fe () (command"_AeccQuickEditFeatureElevs") )
(defun c:fl () (command"_AeccDrawFeatureLine") )
(defun c:fc () (command"_AeccCreateFeatureLines") )
(defun c:fj () (command"_AeccJoinFeatures") )
(defun c:fi () (command"_AeccInsertFeaturePI") )
(defun c:fg () (command"_AeccSetFeatureGrade") )
(defun c:fre () (command"_AeccSetFeatureRefElev") )
(defun c:fb () (command"_AeccBreakFeatures") )
(defun c:fd () (command"_AeccDeleteFeaturePI") )
(defun c:fa () (command"_FeatureAddAsBreakline") )

 

 

 

 

 

 

 

 

 

 

 

I’ve even made a cute dialogue box that you can open by clicking my “HINT” tool in the tool palette.

01-03.png

 

     You may notice the two buttons below HINT, “CAD Help” and “CAD Standards”. The CAD Help button will start an email to our CAD helpdesk and open a support ticket. The CAD Standards button will open our company portal with examples and detailed instructions for file setup as well as plan production sheets.

 

Next time

 

     Next in the series, I will talk about the tool palette and how utilizing a networked and protected standard can bring the company closer, while acting like a portal to the CAD management team.

 

Thanks team!

14 Comments