Here’s a Autolisp script I wrote to help one of our project teams prepare their drawings as a conformed set to the client. They needed to print a set of drawings showing the revision deltas (those little triangles with numbers in them identifying which revision each change was a part of) but not the revision clouds. There were lots of these revision deltas and clouds (as there are with all projects) and they just needed a clean, readable set.
So this seems reasonable enough and maybe even easy, just freeze the layer or layers with the revision clouds and not the layers with the revision deltas - this can be done with a simple AutoCAD script. I can post an example of this if someone asks - I write them for almost every project at some point or another. Even though we have some powerful custom tools that allow us to manage layer visibility externally, this kind of very basic scripting knowledge is invaluable. Particularly those specialists managing large projects, but even those users pulling together small sets with just few people can use something like this to speed things up and prevent repetative action errors. In this case it wasn’t that simple (obviously, or I wouldn’t be writing such a lengthy post) and if you’ve ever had to deal with a request like this you might ask if there are ever any cases that are that simple. Well… yes, there are. But now back to the task at hand… I’m sure you know where I’m going, the revision clouds and deltas were on the same layer in some files, they were on different, but inconsistently named layers in other files, other linework and text were drawn on the same layers as the deltas and revision clouds, some were drawn in the sheet file and others in the annotation file (an xref), etc. It was a big task considering there were 1000+ sheets and at least that many more xrefs that needed to be checked. With a deadline looming and no budget for manpower, this was not something we could brute force. We needed automation and quick.
Below is the script I came up with in all it’s commented glory. For now I’ll just let is stand at that; it wasn’t a perfect script and there was some measure of manual checking, but it got the bulk of the work done in short order. I’ll have to let this post sit for awhile and come back to it after rereading it once or twice. I learned a lot about logic and scripting writing this and several portions of this script seem to reappear often enough to get their own post so for now, for the adventurous, enjoy!
;;
;; ChLayer.lsp
;;
;; ChLayer
;; Routine to select rev clouds on a specified layer(s), move them to a non-plotting layer
;; then freeze the new layer.
;; by Eric Stimmel
;;
;; last updated 9/24/2008
;;
(defun c:chlayer (/ lay_name lay_name_new ss1 n index ent1 a1 a2 b1) ; Define the function
(setq lay_name "A-ANNO-R*") ; Specify the layer(s) that the rev clouds are currently on
(setq lay_name_new "A-ANNO-REVS-NPLT") ; Define target layer to change rev clouds to
(setq ss1 (ssget "X" (list (cons 0 "LWPOLYLINE")(cons 8 lay_name)))) ; Select all lwpolylines on the specified layer
(setq n (sslength ss1)) ; Measure the number of entities in the selection set ss1
(setq index 0) ; Set the variable called index to 0
(repeat n ; Begin the loop that pages through the selection set
(setq ent1 (entget (ssname ss1 index))) ; Get the entity list and assigns it to ent1
(setq b1
(subst (cons 8 lay_name_new)
(assoc 8 ent1)
ent1
)
) ; Change the layer code for each object in the set
(entmod b1) ; Modify the the entity's layer in the drawing
(setq index (+ index 1)) ; Increas the index variable by 1 and loop
) ; Close the repeat loop
(command "LAYER" "FREEZE" "A-ANNO-REVS-NPLT" "") ; Freeze the new layer
(princ) ; Exit quitely
) ; Close the function
(c:chlayer) ; Run the function
PS - I’m sure I swiped some of this code from various places around the internet. I’m not sure from where or when, but thank you to everyone posting and explaining their code. I’ll do my best to contribute and attribute whenever possible.
Recently The Science Channel’s Build It Bigger profiled the Al Hamra Tower in Kuwait. You can see a couple sample videos here and here. I wasn’t able to catch the entire episode, but hopefully through the magic of time shifted video (i.e. video on the web, Netflix, etc) I will get to sit down and enjoy all 42 glorious minutes of it.
I intended to post this earlier, but alas, I’ve been busy. I haven’t worked on many towers since joining SOM, but I was able to lend a hand with a small scripting task on this one. It was nothing of any design consequence, but it gave me a chance, early on in my tenure, to look at how the files were set up and to understand a bit about the efficiencies that are possible when working extensively in a specific building typology.
I’ll post more extensively on this script, since I think it is a good illustration of the kind of thinking required when working with both computers and humans. It was also one of the first times I was confident enough to say “I can do that” without really knowing how I was going to accomplish it.
While I try to get my head above water at work (and put the polishing touches on a few longer posts) I thought this would be a good time to share a little Revit workflow tip I discovered yesterday. I am working on a new project with some consultants who are working in, well, not-Revit. We export our backgrounds to them as DWG files and they astutely pointed out that our exports weren’t showing existing features on separate layers. I never noticed this before since most of our projects are new buildings, so the amount of demo and existing walls, doors, windows and other features were pretty minimal if not nonexistent. It was a reasonable request, so I did a little digging and questioning and actually found very little. So I was left to testing and this is what I discovered.
Revit can export views to AutoCAD and maintain the phase information of the objects (contrary to my past experiences) by separating objects on in different phases onto different layers. It will do this by appending a code to the end of the layer, so for example if you have a wall set to export onto layer A-WALL-FULL, if that wall is set to be demolished it will export onto A-WALL-FULLDEMO and an existing-to-remain wall will export to A-WALL-FULLEXST.
The trick to this is to set the Phase Filter of the view being exported to Show All. If the view you are exporting is set to a phase filter of Show Complete there will not be any phases appended to the layers; all objects, regardless of phase, that are visible will be exported to the same specified layer (in this case A-WALL-FULL), but if your phase filter is set to Show All then existing (EXST) and demo (DEMO) will be appended to the layers for any objects that are set accordingly.
I am not clear if these codes (EXST and DEMO) are hard coded or if they can be modified in a setting somewhere, but this seems sufficient for most needs. It’s not AIA Standard layer naming, but it is close enough and if we needed to, we could add a line to our post-processing script to update the layer names in the exported files. (More on this post-processing in another post.)
I spend more time scouring the internet for answers than I care to calculate and I often find that the answers to my questions are never fully formed or clearly articulated in one place. The answers are there, they just lack structure and specificity in the service of my projects. This is, of course, the nature of “research” as it is done in support of new work. It means these are good, hard questions… either that or they are of absolutely no concern. To anyone. In either case, this blog will be my contribution to the cacophony of the web as it pertains to BIM, computational design, productivity, scripting and anything else that strikes me as being of interest to architects, designers and builders. With any luck you will find something useful here and build upon it.
I should add, in this first post, that the impetus to finally start this blog comes from some recent discussions I’ve had with a few of my coworkers about promoting and sharing knowledge. We are generally in favor of it. It helps elevate the level of discourse and it gives us a chance to show off what we are capable of. That said, let’s just put it in writing that the opinions expressed on this blog are mine and don’t necessarily represent those of my employers, my coworkers, my family or even my closest friends. The content is mine, unless otherwise credited, and any similarity to any real person, living or dead, is purely coincidental.