October 28, 2018

ACA: Custom Profile for Railing Plan Display Representations

As noted in a previous post about Custom Blocks for Railings, those blocks can only be attached to the Model Display Representation. While the Plan, Plan High Detail, Plan Low Detail and Plan Screened Display Representations do not allow for Custom Blocks, they do allow for Custom Profiles, which may work for showing a base plate at each post, depending upon how fussy you are about the graphics. One might first ask the question, "Do I really need to see base plates in a plan view of a Railing?" At typical plan scales (1:100, 1/8" = 1'-0", 1:50, 1/4" = 1'-0"), one could make a convincing argument that the added graphic will, at best, be a slightly wider blob, with the lineweights causing the plotted linework to merge with the railing and post graphics. For the purposes of this example, lets say that for the High Detail Display Configuration/Plan High Detail Display Representation Set (Top view direction)/Plan High Detail Display Representation for Railings, we do want to show the base plates. This can be done by adding a Custom Profile to the post components.

Before we can add a Custom Profile, we have to define the Profile. To do so, I drew a closed Polyline to show the 5.5" x 2" top view rectangle of the base plate that was created in the previous article, as shown in the image below, taken from a SW Isometric view. The Color 140 diagonal line is a Line on layer G-Anno-Nplt and will not be part of the profile, but is there to make it easy to specify the insertion point of the Profile, by snapping to the midpoint of the Line.

Create a Profile from this Polyline by doing the following:
  • Select the Polyline, and right click. Choose Convert To > Profile Definition from the context menu.
  • At the Insertion point or [Add ring Centroid] command line prompt, select the midpoint of the diagonal Line, using the Midpoint object snap.
  • In the New Profile Definition dialog, enter a name for the Profile, in the New Name edit box. I chose to call the Profile in this example RailingPostBasePlate. Select the OK button.

The Profile for the base plate is now available. If you want, you can open the Style Manager and take a look at it, under Multi-Purpose Objects > Profiles. If you do take a look, close the Style Manager without making any changes.

The newly created Profile can now be added as a Custom Profile to the Posts in the Railing.
  • Edit the Railing Style.
  • On the Display Properties tab, select the Plan High Detail Display Representation. Depending upon what view direction and Display Configuration are current, this may or may not be the Display Representation in bold type.
  • Left click on the toggle in the Style Override column on the Plan High Detail Display Representation line to create a style-level override and open the Display Properties dialog for the overridden Plan High Detail Display Representation.
  • In the Display Properties dialog, select the Other tab.
  • Select the Add button. This will open the Custom Profile dialog.
  • In the Custom Block dialog, select the Select Profile button, and then choose the Profile Definition for the base plate in the Select a Profile dialog.
  • Select OK to ratify the choice of Profile and return to the Custom Profile dialog.
  • Since we want this added to the Posts, in the Component area at the upper right, clear the check mark from the Baluster toggle and add one to both the Fixed Post and Dynamic Post toggles. We only want to add this block to the existing posts, not replace the posts, so leave the Replace toggle unchecked.
  • Verify that none of the toggles in the Scale To Fit or Mirror In areas are checked.
  • Verify that the Insertion Point is set to Center for X and Y. This matches the insertion point of the RailingPostBasePlate Profile that was created.
  • Verify that the Insertion Offset values are all set to 0.
  • Choose an appropriate radio button in the Attach To area. Since I wanted all posts to have the base plate, I chose All in this example.
  • Select OK to ratify the Custom Profile settings, dismiss the Custom Profile dialog and return to the Display Settings dialog.
  • Select the Layer/Color/Linetype tab.
  • Notice that, unlike with Custom Blocks, there is not a new Display Component listed for the Custom Profile. Based on some experimentation with the Color property, it does not appear that the Custom Profile is associated with any of the Display Components shown, either, but behaves as if ByBlock were selected for each property.
  • Select the OK button twice, to accept all the edits made, dismiss the Display Properties and Railing Styles dialogs (or, if you edited the Railing Style with the Style Manager, to dismiss the Display Properties dialog and the Style Manager) and return to the drawing.
In a Top view with a Display Configuration with the Plan High Detail Display Representation for Railings active, the added Custom Profile will be seen at the posts. So far as I know, it is not possible to have any rails that cross over the Custom Profiles hide the Custom Profile linework that passes "under" the rail. Most likely because the rail is just two lines in this Display Representation, not a solid object, and ACA has no way of knowing that the Custom Profile represents a base plate down at the bottom of the post.

Given the lack of display control and the resulting graphics, I doubt that I would use a Custom Profile to represent a railing base plate; certainly not one of this size relative to the size of the railing. I would probably only show this in a detail, with independent linework, rather than as part of the model. One other interesting effect to keep in mind should you decide to go this route, if you add a Custom Profile to all of the posts in a Railing that is anchored to a Stair object, the Custom Profile will display for each post, even those that are not drawn in the view because they are above the cut plane of the Stair. Checking the Replace toggle in the properties of the Custom Profile, so that the Profile replaces the graphics of the posts does not affect the display behavior here. The posts will not be drawn, but all of the base plates will show at the Stair, and they will display with ByBlock display properties, not the display properties assigned to any of the post components.

October 24, 2018

ACA: Custom Block for Railing Model Display Representation

The Model Display Representation of Railings in AutoCAD® Architecture allow for the addition of custom blocks to create additional display components for the Railing. For example, you can add base plates to the Railing Posts. For this example, I started with the out-of-the-box Guardrail - Pipe Railing Style and renamed it to Guardrail - Pipe with Base Plate.

The first step is to create an AutoCAD Block Definition to represent the base plate. I decided that the base plate should be 5.5" long, 2" wide and 1/4" high, and I wanted to be able to use the same Material Definition that is used for the Railing, so I chose to use a Mass Element for the base plate, and created a Mass Element Style, called Stainless Steel, that had the same Material Definition assigned. In the example file, which can be found in this AutoCAD Architecture forum post, I used the out-of-the-box Metals.Metal Handrails and Railings.Stainless Steel.Satin Material Definition. Using the Stainless Steel Mass Element Style, I created a "Box" shaped Mass Element of the desired dimensions.

I then made a Block Definition with the Mass Element as the only included object, with the insertion point at the centroid of the bottom face of the Mass Element.


With the Block Definition created, the next step is to add it to the Railing. This is done in the Railing's Display Properties, in the Model Display Representation. Because I want this block to be added to all instances of this Railing Style, but do not want it to be added to all Railings, this was done as a Style-level Display Override.
  • Edit the Railing Style.
  • On the Display Properties tab, select the Model Display Representation. Depending upon what view direction and Display Configuration are current, this may or may not be the Display Representation in bold type.
  • Left click on the toggle in the Style Override column on the Model Display Representation line to create a style-level override and open the Display Properties dialog for the overridden Model Display Representation.
  • In the Display Properties dialog, select the Other tab.
  • Select the Add button. This will open the Custom Block dialog.
  • In the Custom Block dialog, select the Select Block button, and then choose the Block Definition that contains the base plate in the Select a Block dialog.
  • Select OK to ratify the choice of block and return to the Custom Block dialog.
  • Since we want this added to the Posts, in the Component area at the upper right, clear the check mark from the Baluster toggle and add one to both the Fixed Post and Dynamic Post toggles. We only want to add this block to the existing posts, not replace the posts, so leave the Replace toggle unchecked.
  • Verify that none of the toggles in the Scale To Fit, Mirror In or Rotate areas are checked.
  • Verify that the Insertion Point is set to Center for X and Y and Bottom for Z. This matches the insertion point of the RailingPostBasePlate block that was created.
  • Verify that the Insertion Offset values are all set to 0.
  • Choose an appropriate radio button in the Attach To area. Since I wanted all posts to have the base plate, I chose All in this example.
  • Select OK to ratify the Custom Block settings, dismiss the Custom Block dialog and return to the Display Settings dialog.
  • Select the Layer/Color/Linetype tab.
  • Notice that there is a new Display Component listed, with the same name as the name of the Block Definition selected for the Custom Block. You can make any desired settings here, but since a Mass Element is the only element in the Custom Block, it will follow its own display settings for the Model Display Representation. The out-of-the-box drawing default settings display Mass Elements "By Material" for the Model Display Representation, just like all of the other Railing components. Since the same Material Defintion is assigned to the Railing components and the Mass Element in the Custom Block, they should all display alike. (If you really wanted to control the display properties of the Custom Block on the Layer/Color/Linetype tab of the Railing Display Properties, you could set a Style-level display override on the Mass Element Style for the Model Display Representation, clear the ByMaterial toggle and set all of the properties in the Mass Element Style Override to ByBlock. But that is not the goal in this example, and beyond the scope of this article.)
  • Select the OK button twice, to accept all the edits made, dismiss the Display Properties and Railing Styles dialogs (or, if you edited the Railing Style with the Style Manager, to dismiss the Display Properties dialog and the Style Manager) and return to the drawing.
If you do not already have an instance of the Railing Style in your drawing, add one, and then change to one of the isometric view directions, if you are not in one already. You should see the Custom Block at the bottom of each post.
The baseplate will show whenever the Model Display Representation for Railings is active, which is just about any Display Configuration/View Direction combination where Railings are turned on, except for the Top view direction, where one of the "plan" Display Representations will be used. The Plan Display Representations do not allow for attaching Custom Blocks, but they do allow for adding Custom Profile Displays. An article on how to do that can be found here.

October 15, 2018

Dynamo: Export Views and Sheets from Revit - Part 4

First post in this Series [Part 1]
Previous post in this series [Part 3]

This post describes the nodes that generate the file names for the exported drawing files. As you may recall from the previous posts in this series, a list of Views and Sheets was generated from a user-created ViewSheetSet in Revit® by a Python Script node. That list was then separated into two lists, one for Views and one for Sheets, to allow for separate naming conventions for the exported drawing files for each. (Specifically, so that the sheet number can be included in the file name for Sheets.) The nodes that do this are contained in three groups: Generate Names for Exported Views, Generate Names for Exported Sheets and Combine Names....
All three groups make use of out-of-the-box nodes. The first two groups are nearly identical, and can be described simultaneously. The first node in each of those groups is a Code Block node, renamed to Exported DWG File Name Format for Views for the exported Views and Exported DWG File Name Format for Sheets for the exported Sheets. Each of these nodes has one input, view which takes the respective list from the List.FilterByBoolMask node covered in Part 3. A combination of parameter values associated with each View/Sheet and text is used to create the file name for each View/Sheet:
  • For Views: dwgname = view.Name + "_Export" + ".dwg";
  • For Sheets: dwgname = view.SheetNumber + "_" + view.Name + "_Export" + ".dwg";
The drawing name for Views concatenates the view.Name parameter value with "_Export" and the ".dwg" file extension. The drawing name for Sheets is similar, but adds the view.SheetNumber parameter values at the beginning, separating the sheet number from the sheet name with an underscore ("_") character. This is what I set up as a default for use in my office; you can customize this to meet your needs by adding, removing or rearranging the parts.

The lists of Sheet and View names are then run through two String.Replace nodes. The first replaces any asterisks ("*") with underscores ("_") and the second replaces any forward slashes ("/") with hyphens ("-"), as neither of these characters are permitted in a drawing file name, even though they are allowed in a View or Sheet name in Revit. Each resulting list of file names is then passed through a Watch node, so that the contents can be inspected after the graph is run. These two lists are then sent to the Combine Name... group, where a List.Create node and a Flatten node combine them into a single list. An optional Watch node is included here, as well.

So now we have a combined list of View and Sheet objects (from Part 3) and a combined list of file names for the corresponding exported files. The next post will look at the remaining user input nodes.

September 25, 2018

Revit: 2018.3, Windows 10 and No Material Browser

I discovered today that I was not able to open the Revit® Material Browser (on the Manage ribbon tab, on the Settings panel, selecting the Materials tool). As luck would have it, I am quite a bit behind in reading the Autodesk Revit Architecture Forum, and I just happened to have read a thread about this issue earlier today. In the Materials Dialog Box Doesn't work thread, a post by richard.horner, building off the previous post by stewart.jex, provided the solution that worked for me. I know I will not be able to find that thread when I need it in the future, and since the solution is not at all intuitive (I still cannot figure out why it works), I decided to document it here.

  1. In the Revit session in which you discover that the Material Browser will not open, go to the Application Menu (File "tab"), and choose Options.
  2. In the Options dialog, choose Hardware on the left side.
  3. On the right side, in the Hardware setup area, clear the checkmark from the Use hardware acceleration (Direct3D®) toggle.
  4. Select OK to ratify the change and close the Options dialog, and then close Revit. (Changes to hardware acceleration do not take effect immediately.)
  5. Restart Revit, and open a project file.
  6. On the Manage ribbon tab, on the Settings panel, select the Materials tool. The dialog opens! (Great, but who wants to run Revit without hardware acceleration, right? The next part is the bit that I cannot figure out.)
  7. Close the Material Browser.
  8. Open the Options dialog again, select Hardware and select the Use hardware acceleration (Direct3D®) toggle to re-enable it. There should be a checkmark in the toggle.
  9. Select OK to ratify the change and close the Options dialog, and then close Revit.
  10. Restart Revit, open a project file and then try to open the Material Browser again. It works!

While the analytical part of my brain wants to know why the exact same settings that previously failed now work, the "hey, you found a solution, now lets get on with what you were trying to do originally" part of my brain is declaring victory and moving on. And I will be carefully looking both ways crossing streets on my way home this evening, as I have clearly used my luck for the day.

September 12, 2018

Dynamo: Sorting a List of Lists by a Value in the Sub-List in Python

I had a list that was composed of sub-lists, each sublist contained a Sheet Object and the values of three parameters associated with that Sheet, including the Sheet Number. I wanted to be able to sort the sub-lists in ascending order of the Sheet Number value in each sublist. I found the following Python code does the job:
sortedLists = sorted(listOfLists, key=lambda x: x[index])
where index is the index of the item in the sub-list on which you want to do the sorting.

For example, given a list with four sublists, similar to that in the image below,
where the index of the Sheet Number in each list is 1, the code below
will sort the sub-lists by the item in index 1 of each sub-list, with a result of

This page on the stackoverflow website helped me work this out. Two additional notes:
  • If you want to replace the original list with the sorted list, you can use this syntax:

    listOfLists.sort(key=lambda x: x[index]).

  • If you want to sort in descending order, add reverse=true as a parameter:

    sortedLists = sorted(listOfLists, key=lambda x: x[index], reverse = true)

    or

    listOfLists.sort(key=lambda x: x[index], reverse = true).

September 01, 2018

Dynamo: Export Views and Sheets from Revit - Part 3

First post in this series [Part 1]
Previous post in this series [Part 2]

This post describes the nodes used to separate the Views from the Sheets that were obtained from the ViewSheetSet that the user specified as the source of Views and/or Sheets to be exported. This Dyanmo graph generates file names for the exported Views/Sheets. In order to be able to use the Sheet Number in the file name of exported Sheets, Views and Sheets need to be processed separately when generating the file names as Views do not have a Sheet Number parameter, so that cannot be part of the name generation code for Views. Separating the Views from the Sheets in two separate lists and processing each list separately when generating the file name seemed like the easiest way to handle that.

As noted in Part 2, the Python Script 1 node generates a list of View and Sheet objects, based on those included in the ViewSheetSet specified by the user. In order to separate that list into two separate lists, the List.FilterByBoolMask node is used. That requires a Boolean Mask, which is a list of true and false values. Items in the original list whose index corresponds to a true in the Mask list end up in the "in" output list. Those that correspond to false become part of the "out" list. The nodes in the lower left corner of the image above generate the Boolean Mask:
  • The list of Views/Sheets in the Set are fed into the "element" input of a Element.GetParameterValueByName node.
  • A String node provides the input to the "parameterName" input, with a value of "Category".
  • This creates a list of category objects, representing the category of the items in the View/Sheet list.
  • That list of categories is converted to a list of strings, representing the name of each category by the Element.Name node.
  • This list of strings is then passed to the Equal x to y? operator node (==), as the "x" input.
  • The "y" input is provided by a String node, with the value "Views".
  • The output will be a list of true/false values, based on whether the category name is "Views". Any Views on the original list will have a true value, and any Sheets will have a false value on that list.
Feeding the original list of Views/Sheets into the "list" input of the List.FilterByBoolMask node and the Bool Mask we just created above into the "mask" node will send the Views to the "in" output and the Sheets to the "out" output. These are sent to the respective file name generation nodes, to be covered in the next post in this series.

But before closing, there are two additional nodes in the blue node group in the image above. Eventually, we need to export the Views and/or Sheets, so we need to recombine the separated lists. I chose to put the Views first and the Sheets second, and used a List.Create node to combine the two. The List Create node will generate a list with two sublists, one of the Views and one of the Sheets. I just want a single combined list, which the Flatten node creates.

Note also that it is perfectly acceptable for the ViewSheetSet to have only Views or only Sheets. The nodes above will still generate two separate lists; one will just be empty.

Next post in this series [Part 4]

August 13, 2018

Revit: Design Options in Linked Revit Files Not Respected as Room Boundaries

I was trying to assist on a project in the office today (using Revit® 2018.3), when I ran into this issue, documented by Dave Baldacchino nearly six years ago. I set up a simplified set of files for experimental purposes; the images below demonstrate the problem remains an issue at least through 2018.3.

I created a "link" model, that has one Design Option Set (Exterior Walls) which in turn has two Design Options, Option 1 (primary) and Option 2. Each Design Option has one Wall object, running in the Project North-South direction (up and down on the screen). These are identical, with the exception that the Wall in Option 2 is offset 10 feet in the direction of Project West (left on the screen).

The link model is linked into a "host" model (origin to origin; both files were started with the same template file). In a floor plan view, four additional Walls were drawn, and two Rooms with Room Tags added. In the image below, the link model is showing Option 1 (primary). The link model is selected, and its type properties displayed to show that the link model is set to be room bounding. Interior Fill is turned on for the Rooms, to illustrate their extents.

No surprises there. But change the Visibility Graphics Overrides for the linked model to display Option 2, and the Wall moves 10'-0" to the left, as expected, but the Rooms stubbornly maintain their extents at the face of the Option 1 (primary) Wall location.

The workaround, to make the linked file not be room bounding, and to draw Room Separation lines in the host file, is not going to make anyone on that project team very happy.

August 10, 2018

Dynamo: Export Views and Sheets from Revit - Part 2

First post in this series [Part 1]

This post will cover the part of the graph that gets the list of Views and/or Sheets from a user-selected ViewSheetSet that are to be exported.
As noted in Part 1, the user has to create a View/Sheet Set in Revit® and add all of Views and/or Sheets to be exported to that set. The user enters the name of that set into a string node, labeled ViewSheetSet Name - String in the green-colored group labeled 2. Enter Name of Set to Export. Just above that, the Element Types node is set to the ViewSheetSet type, which is then fed to the All Elements of Type node to get a list of all of the ViewSheetSet objects in the active project. This list of ViewSheetSet objects is passed to the Element.Name node, which generates a list of the names (as strings) of those ViewSheetSets. This list is passed to the IndexOf node, along with the name that the user entered, to determine the index of that name on the list. Finally, the list of ViewSheetSets and the index of the desired ViewSheetSet are passed to the List.GetItemAtIndex node, to get that ViewSheetSet object.

During my initial testing, I passed the ViewSheetSet object to an Element.Parameters node, to see what information could be obtained from the object. The list of Views/Sheets included in that ViewSheetSet was not found there, so this node need not be included in the final graph. It turns out that there is not a node that ships with Dynamo that will generate a list of Views/Sheets that are included in a ViewSheet Set, and I was not able to find one in any of the third-party packages I have installed. I was able to find this thread in the DynamoBim.com Forum, in which Kulkul posted the Python code needed to extract a list of the Sheets/Views. My adaption of that, shown in the image below, is the code behind the Python Script 1 node, which takes the desired ViewSheetSet object as input and generates a list of the included Views and Sheets as output.

That list of Views and Sheets is then sent to several locations. During development, I added an Element.Name node and two Watch nodes to view the list. These do not need to be part of the final graph, but I left them in as a way to visually check that the correct ViewSheetSet was obtained.

In the next installment, I will cover the nodes that separate the list of Views/Sheets into separate lists of Views and Sheets. I wanted to do this so that I could include the Sheet Number value as part of the name of exported Sheets. Since Views do not have a Sheet Number property, they needed have the name of the exported drawing generated separately.

Next post in this series [Part 3]

July 27, 2018

Revit: Sheet Ribbon Tool Inactive

This issue came up today, and I wanted to document the solution for future reference. A user was working on a model, in Revit 2018, and was trying to create a new Sheet. On the View ribbon tab, on the Sheet Composition panel, the Sheet tool was inactive.

She was working on a project that had Design Options, and one of the Design Options was set active. The solution was to use the Active Design Option selector on the Status Bar and set it to Main Model. You can only create new Sheets in the Main Model.

July 18, 2018

Revit: Multi-Line Viewport Titles on Sheets

I was asked about this today, and decided to record the solution in a blog post, for future reference. Viewport Titles in Revit® will wrap onto a second line when the length exceeds what will fit, based on the length of the label in the Title Family, but often the user wants control over where the wrapping occurs. If your office protocols allow for using the Title on Sheet property of a Viewport for the title that is shown on the Sheet (rather than using the View Name), then you can set a line break at the cursor location in the Title on Sheet property edit box in the Project Browser by pressing CTRL+ENTER.
And, no, there is no significance to the contents of the Drafting View that I used as my test case, shown in the image above. They are just some semi-random Detail Lines drawn so that there would be something to see when the Drafting View was placed on a Sheet.