Automatically Populate ADT Layers from your Layer Key

Can’t wait for ADT to create a layer for your object? Do you want to ensure that the layers you create are generated by your layer standard? You can write your own Layer Populate routine for any version of Architectural Desktop 2002 (3.3) and above using the following code inside the VBA editor. Ready? Lets get started.

  • Create a new VBA project…I called mine MakeKeyLayers.dvb.
  • Select your new project in the Project explorer window and rename it…I called mine CreateLayersbyKey
  • Add the following reference files (for ADT 2005) by clicking “tools” then “references” from the menubar in the VBA editor. You will need to add: AEC Base 4.5 Application Library, AEC Base 4.5 Object Library, AEC Architectural 4.5 Application Library, and AEC Architectural 4.5 Object Library.
  • Note: if you are running ADT 2004 the libraries have 4.0 instead of 4.5 in the name, ADT 3.3? 3.0 instead., ADT 2006? Not sure, I haven’t loaded it yet. I’m sure someone will chime in.
  • Download listing #1 by clicking here.
  • Right click in your project explorer window and choose “import file.”

Add this routine to your startup suite or write a little lisp loader so that it is always loaded and available. Hope this saves you some steps!

Visual Lisp Repathing for ADT Tool Palettes

A recent post on the AUGI Forums asked for a method to convince Autodesk Architectural Desktop 2005 to look for AEC content on a network folder instead of the local harddrive. The suggested answer was to force a new profile on the computer. Unfortunately, this will also reconfigure the users desktop, move toolbars, and change other settings that might make your users uncomfortable. Additionally, if you have Building Systems users then you have to create an additional profile just for them. Rather than completely reconfigure the profile, I thought a lisp solution made sense.

Since the AEC Content folder are available within the options menu, a single user could easily navigate to the correct tab on the options menu and make the following change:

But making that same change could become a nightmare if you have to support more than a handful of users. Enter Visual Lisp:

Using some of the built in VisualLisp functions it is easy to create a generic routine that can repath the standard AEC Content locations which the standard tool palettes will then automatically take advantage of. This routine also works for Building Systems 2005. (I’ll update it for 2006 when I get the opportunity!)

We can take advantage of the product key (vlax-product-key) to detect the Product Name and Type.

Using that allows us to construct a path to the registry key containing the location of the AEC Content (ToolContentRoot).

Now it becomes easy to effectively change the location to a new path on the fly by writing our new value back to that registry key.

Need proof? Here is where the tool palette content comes from after running this routine.

Take a look at Listing 1 for this code and the code used to change the default Design Center content path as well. Here is the entire routine.

Click this to download the lisp file.

Not a member of AUGI yet? Join now.