Friday, July 9, 2010

Multiple Levels in a single Drawing File? Part 2

Ok so are you interested enough to read further on this idea?
I can promise a productivity boost on residential and small commercial projects.  Following the OOTB processes can at times lead to a lot of the confusion attributed to ACA/ADT when simpler processes could have been put in place.  The OOTB processes are also detrimental to efficient production especially when you want to turn (churn) out fast renders as well.

Here is the recipe on how I achieved it and it was much simpler than I thought it would be. So simple that I ponder why Autodesk hadn't provided this as an option.  Oh and this is just background of how it works.  You don't have to understand or recreate this.

Let's go to the the list of the items I posted in Part 1 in more detail.

A Layer Key Style that holds a Layer designator.
We all work differently and we need to have the items required for our environment. For very large projects, you may have multi disciplinary drawing files but for the most part, I would complete my set of architectural drawings and a structural engineer would complete his own set of drawings. Maybe a hydraulic engineer would be required or perhaps a civil engineer but they would also complete their own set of separate drawings (& CAD files). So there is no need for me to preface a layer with an A.  I preferred the level indicator to be first and I use a simple number. '1'. It's great to open the layer dropdown and type S and go straight to the Site-* layers. But it doesn't really matter because as long as your level indicator is in the same place you can use the '-layer' command to find and manipulate your layers. So 'A-Wall-L1' or 'A-Wall-FLR2' is ok. Because the layer manager dropdown display is so narrow and only shows a limited number of letters I try to keep mine simple. You cannot mix A-Wall-L1 and A-Wall-Blow-L2 though as the level indicator is in 2 different places (3rd and 4th along) (In my system anyway).

(Odin Cary of Archidigm has excellant explanations on all things ADT/ACA in his Development Guide.  Check out under section 2 for Layer Key Styles.)

As an explanation;
From the command line I can issue -layer , select 'OFF' and then using a wildcard such as 1-* have all the layers starting with 1- turning off. (The * being a wildcard for those not familiar). I could also issue *-*-FL1* but of course it will fail if the level is not in a consistent position in your layer names. If the level is always in the 3rd position it should work. Therefore I chose to put it in the first position and also allow me to sort my layers naturally by level.
(I've seen a wish list item posted several times to allow layer groupings, but this is not available at this time).

However this does not prevent me from sorting via major item either. Issuing the -layer command again and OFF and *-Wall* would turn all wall layers off regardless of their level.
So from this basis we can turn all layers off using the * wildcard and then turn back on those we want to work with. Therefore in lisp fashion the following lines...

(command "-LAYER" "m" "0" "F" "1-Elec*" "OFF" "*" "N" "ON" "1-*,1+*" "")


...sets layer 0 as the current layer, freezes the electrical layer (as I only want that one on when doing electrical layouts), turns all else off, then turns on the level 1 (and 1+) levels (except the frozen electrical layer).

My system uses the difference between freeze and off for layers. Frozen layers do not regenerate and reduce the load on the display system. Off layers are generated though not displayed and are quickly turned off & on. So by freezing layers I don't want to see for a while and turning off layers I might want to edit quickly in my next move, I can have a fast responsive system.

I used the 1+ Stair for items that would span more than one level so they would show also on the 2nd floor as well (but with a different cut plane and display rep - more on that one later).

So if we tie the above lisp line to a simple command, say 'L1', then we have created a new command to show us all the layers on level 1 only. More on this layer..er...later.

I also use other 'level' indicators to sort layers such as Site-, 3D- for info only used for modelling or elevations and not required in plan views. Your Layer Key Standard will set whether your layer names have to follow a strict or loose convention. Some LKS's have strict 1--4-4-4 numbers of alphanumerics generally with the last 2 places being optional. Mine has no restriction on the number of each. I find the AIA layering system, designed to organise a hospital complex way overkill for simple residential so don't feel tied to such a system if it's not needed. 

Hey try this. If you have an x-ref in your drawing, use the layer command to freeze all it's layers like this -layer F X-RefName|* The | symbol is shown in the layer name itself in the Layer Manager between the x-ref name and the layer name (inside the x-ref).   I have my survey as an x-ref named 'Survey' and using this info I can freeze all survey info in my drawing using lisp.

All new to you? Open your Layer Manager and click on the 4 buttons top right. I'll try to add some good links here for simple tutorials on these great and powerful tools.

Can you see why I have dropped the A- from my layer names. Layers are sorted alphabetically (of course) and you can use this fact to your advantage in your layer scheme. Even keeping your A-, what comes after will determine the sorting order.  In the layer box you can type say 2 and it will scroll to all my 2nd floor layers.

Place to hold your elevation floor level heights.
If you want to switch to the 2nd floor, you need to be able to draw a wall at the 2nd floor height. This height needs to be entered and available to the drawing. I did want to use Fields but as yet I don't know of a way to access them in lisp (strange!). It needs to be saved with the drawing but it's not a drawn entity.  So for the moment I have elected to use Autocad variables (thanks David Koch)  Acad has 10 user set variables available that are stored in the drawing when closed that I can enter and access.  I chose the interger based as I work in mm and won't be requiring any decimal places. If you have decimal places in your floor heights, you will need to use the USERR1-5 system variables as the R stands for REAL.  I assume level 1 at z=0 but level 2 is set in 'USERI2" and level 3 in "USERI3" etc (the 'I' here is an i). My loaded custom autolisp file reads this variable when I open the drawing and assigns the variables FL2 and FL3. These variables (FL2/3) will be lost once the drawing is closed hence the use of the system variables to hold the values over.  An easy way to access these is thru the 'System Variable Editor" available under the 'Express Tools' under 'Tools'.

Now don't worry if this is all confusing to you. I am just trying to give some background info on my method of madness. I can send a template or sample file to you that has these items set up already and I have followed OOTB methodology as much as possible so that I have minimised my customisation. My overriding rule is to Keep It Simple so I assure you it's not complicated.

Next .... Cutplanes, Zplanes and switching Display Representations.

2 comments:

kobi said...

would it be ok to ask for that template file with the lisp
of layers?

thnx

kobi

Nathan Ellery said...

Sure Kobi but I will need an email address. Post another comment with your email I will NOT publish it - I like my privacy too, and I can communicate with you offline.
cheers