Mostly Revit... by Eric Stimmel

Autodesk University

Wednesday, September 15, 2010

I am heading to Las Vegas this year for Autodesk University! I'm attending AU 2010

Revit Journal File Scripting

Thursday, August 26, 2010

Our office uses a custom script to open Revit files. It was developed, at least in part, by JV and, as you might expect, carries with it lots of well thought out, but sometimes complex little pieces. I call it a script, but it’s more than a couple of lines of code. I’ve been digging around in it and making a few tweaks and additions here and there to get it working with Revit 2011. One thing that’s been a stumbling block is the addins. We are using the standards (Worksharing Monitor and Navisworks 2011 Exporter) as well as a few custom tools (these will require some more involved rework that’s a little outside of my current capabilities) and then I have Ian Keough’s goBIM exporter for his wonderful, though still a little tempermental, goBIM iPhone app. I have noticed that, although Revit 2011 offers a new method of loading addins (the .addin manifest), Navisworks still uses a modification to the Revit.ini file. Worksharing Monitor and goBIM both use the .addin method which seems like a much easier path. When using our script to launch a file, only the Navisworks plugin is loaded. When launching a model directly from Revit all three plugins are loaded. This has led me to look at the journal file… and crack open Mastering Autodesk Revit Architecture 2011. Hopefully I will be able to post further development here or at least a small note of success. For now…

LoadFileScript

UPDATE: After some research and hints on the most excellent AUGI forums, and more specifically the thread mentioned in the book above and a couple of newer threads by dbaldacchino and david.kingham detailing their own versions of this script, I have found corroboration that the new .addin method of loading addin’s does not work when launching a file using a journal file. To quote David Kingham:

In 2011 Autodesk changed the way addins are loaded and a big flaw with this is addins do not get loaded when a journal file is used to open Revit (which is how I had previously opened projects)

So the mystery is solved and the rework begins. I have found that once I bypass the use of the journal file to open the files, I am always prompted to choose which worksets to open I can’t control the opening behavior to specify worksets or open all. More testing is in progress - I should know more by the end of the weekend.

Revit 2011 New Features

Wednesday, August 11, 2010

David Light of HOK has a good article in the latest AECEdge describing the new features of Revit 2011. We’ve been looking at this for awhile at work - in fact I’ve just finished creating the 32 and 64 bit deployments so that the office can be upgraded - and it looks to be a great improvement over 2010. Aside from the flashier new features (adaptive components and conceptual massing improvements) I’m really looking forward to the improvements to working with linked models, text, line conversion and the sheet layout tools. We work on some pretty large projects with lots of linked models and managing those projects and maintaining consistency is a full time job. I’m laying the groundwork for a new project that we are estimating will have dozens of linked models… but more on that (and WAFS) later.

Door cut through multiple layered walls

Wednesday, August 4, 2010

For those instances where you have two layered walls (for whatever reason - a small area of ceramic tile or furring that’s easier to manage as a layered wall) and need to have a door cut through both, I found this little gem on RevitCity:

You can use the ‘join geometry’ command to join the tile wall to the base wall and all openings will cut through both walls.

You should check for unintended consequences as always, but it seems to work well in my testing! Thanks to the Reviteer for posting this handy little tip.

ChLayer.lsp

Wednesday, June 23, 2010

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.