January 24, 2021

Network Licenses, Options File, Adding Users to a Group

Not sure I really need to record this knowledge for the future, since we will soon be out of the Autodesk network license business completely. All but 30 of our network licenses made the jump to named-user licenses last Thursday. Perhaps I will post something about that experience, once the dust settles and my anger subsides. Returning to the subject of this post, I needed, for the first time, to set up an options file to limit access to those remaining 30 licenses for those running Revit 2016, since the 2016 (and older) releases of Autodesk software have to be uninstalled and reinstalled to change the license type. In my opinion, that is too much work for something that will no longer be "of right" licensed in two or three months. But we do have a few active projects in Revit 2016 that the project teams do not want to upgrade (or do not want to upgrade at this point in time, due to imminent deadlines). The problem is we were not able to convert everyone over to named user licenses for 2017 and later versions before the end of the grace period, and the unconverted users were taking all of the licenses.

What I discovered this evening/this morning is that when specifying the user names for the group I was creating in the options file, you do NOT include the "@" and the computer name as part of the user name. I had always seen users being reported with their Windows login name followed by "@" and then the name of the computer on which they were running the software that was asking for the license, so I foolishly assumed that was how the user name should be specified. But when I reread the license with the new options file in place, I was not able to get a license myself, and someone who had a license checked out who was on the list was also denied. I panicked, and put back the old options file. I looked at the instructions again, and noticed that the examples only had a user name, without any machine designation. I then added my user name, without a machine name in addition to my user name with a machine name, reread the license, and I was able to get a license. Then I removed my user name with the machine name, and it still worked. Adding the other user with out the machine name allowed that license to also be checked out, convincing me that was the correct approach. So now all users that I want to include have the"@" and machine name removed, and I am fairly confident that will work. I guess I will see Monday morning.

December 04, 2020

Revit: Text Parameter Value Driven by Four or More Yes/No Parameters

Regarding my last post, I would be remiss if I did not point out that FAIR59 also replied, with a more elegant solution that is also easier to expand to 5, 6 or more parameters. Check out that post here.

December 01, 2020

Revit: Text Parameter Value Driven by Four Yes/No Parameters

I came across an interesting request in the Autodesk Revit Architecture forum the other day. The person wanted to have four Yes/No parameters (called A, B, C and D) determine the value of a text parameter (called TEXT), based on the following conditions:
  1. If two or more of the four Yes/No parameters are checked, the value of TEXT is to be "SELECT ANY ONE".
  2. If none of the four Yes/No parameters are checked, the value of TEXT is to be "NO TEXT".
  3. If only the A parameter is checked, the value of TEXT is to be "A".
  4. If only the B parameter is checked, the value of TEXT is to be "B".
  5. If only the C parameter is checked, the value of TEXT is to be "C".
  6. If only the D parameter is checked, the value of TEXT is to be "D".

The solution I devised uses a series of nested if statements to work through all of the possibilities. The condition of the first if statement is an or. Each item in the or is an and of a pair of the Yes/No parameters. There is an and for each possible combination of the four Yes/No parameters. If both items in at least one of the combinations of Yes/No parameters is true, then the entire or evaluates to true. That takes care of all of the situations where two or more of the Yes/No parameters are checked, and "SELECT ANY ONE" is returned.

The else of the first condition then launches a series of if statements that tests whether a given Yes/No parameter is checked, starting with A. If A is checked, "A" is returned; if not, another if statement tests for a check in B. If B is checked, "B" is returned, and so on through to D. If D is checked, "D" is returned; if not, "NO TEXT" is returned.

Here is the formula:
if(or(and(A, B), and(A, C), and(A, D), and(B, C), and(B, D), and(C, D)), "SELECT ANY ONE", if(A, "A", if(B, "B", if(C, "C", if(D, "D", "NO TEXT")))))

And a screen capture:

November 25, 2020

Revit: Extracting Level Names in Dynamo

A few weeks back, I had a request to be able to filter a Door Schedule by the Level to which the Doors in the project were associated. That is a choice if you are only scheduling Doors in the current model, but is not an option if your Schedule includes Doors in linked models. I suggested that a Dyanmo graph could be created that would read the Level of each Door and write the Level name to a separate parameter, which could then be used for filtering. The graph would need to be run in each of the models, and, if there are later changes that add more Doors, re-run. Pretty standard stuff for a Dynamo graph.

There is just one problem with that - the built-in Revit parameter Level does not return just the name of the Level, but instead returns what is shown in the image below.

I ran those results through the String from Object node to be certain the values were seen as strings. (I suppose I should try it without that node to see if it is really necessary, but I have not done so yet.) It may be possible to extract the level name for each item on the list using a series of nodes, or perhaps some code in a code block, but the amateur programmer in me wanted to work out how to do so in Python, and it turned out be be quite simple, using string slicing. The start index of the Level name is one more than the index of the equals sign ("=") and the end index of the slice is the index of the comma. A simple for loop processes each item in the list and appends it to the result list. The image below shows the code.

October 27, 2020

Autodesk Extends Previous Version Access

In case you missed this announcement, starting on November 2, 2020, subscription and maintenance customers will have access to the current version and the five most-recent prior versions. Currently, access is limited to the current version and three prior versions.

Technical support will continue to only be provided for the current version and three prior versions. But for large projects, as well as for those medium to small projects that just never seem to end, this may allow you to avoid having to upgrade files to a newer version due to the original authoring version no longer being available.

July 31, 2020

Emojis in File Names

File this one under, "Just because you can, does not mean you should."

A colleague had called my attention to the fact that, in Windows 10, you are allowed to use emojis in file names. (Press the Window key + . to call up a dialog that allows you to select one.) I was pretty sure AutoCAD would have a problem with that, but I was surprised to find that I was able to create a file called ­čŹĽ.dwg and AutoCAD had no problems with it.


I do not recommend doing this with project files. I will also note that I did nothing beyond creating the file. I have not fully tested this. For example, I did not see what happens if I try to externally reference this file, or even just inserting it as a block into another file.

July 10, 2020

Dynamo: Building User Options into a Graph

The goal of the graph on which I was working when I needed to know how to add Shared Parameters to the Other Parameter Group was to allow a user to easily add additional shared parameters that we use to track issued Sheets in our Drawing List Schedule. Our template files have the first ten of these in them, and for some projects, that is enough. Others have many more than ten issuances, particularly those that track issuances during the design phases. We have twenty additional Shared Parameters in our Shared Parameter file; adding more than one of them is tedious, at best.

Using the Parameter.AddSharedParameter node from Erik Falck J├Şrgensen's Orchid package makes it easy to bulk-add Shared Parameters in a Dynamo graph. For this particular task, however, I wanted to be able to offer the end user the choice of adding the second group of ten parameters, the third group of ten parameters or both the second and third groups of ten parameters, without creating separate graphs for each group of ten additional parameters, and without the user having to go into the graph and make adjustments. My solution was to use a Python Script node to handle the user options. Two separate lists of the Shared Parameter names are created, and two Boolean nodes with Is Inupt set allow the user to choose to include one or both of those lists when the graph is run. The Python Script node has four inputs; two for the lists (IN[0] and IN[2]) and two for the Boolean nodes (IN[1] and IN[3]). The image below shows the simple Python code that gathers the input values and then tests the Boolean values, adding the associated list of Shared Parameter names to the output list if the Boolean is set to True.

In Dynamo Player, when the user finds the graph file and selects the Edit Inputs tool, this is what she or he sees:
Both Booleans are intially set to False. Should the user run the graph with both set to False, the Parameter List result will display the string to which the listOut variable is set if the list is empty: "Select at least one set of Parameters to add. " The user only needs to click on the "switch" displayed for each "Add Issues" Boolean to toggle it to True.

The switch turns green when set to True. Once the desired list(s) are set to True, selecting the Play tool will run the graph and the selected Shared Parameters will be added to the active project. The Parameter List result will display a list of the names of the Shared Parameters that were added.

As always, you can select an image to see it full size.

July 02, 2020

Dynamo: Other Parameter Group

Long time, no post. If anyone is still reading this blog, I hope you and your families are doing well in these trying times. A combination of being busy with work (remotely) and not having anything about which to write caused this rather long gap between posts.

I came across something today that I wanted to document for future reference. I was working on a Dynamo graph to automate the adding of specific shared parameters as project parameters in a Revit project file, using the Parameter.AddSharedParameter node from Erik Falck J├Şrgensen's Orchid package.

One of the required inputs is the Group under which the parameter will be organized. The particular parameters with which I was dealing are a continuation of ten that we already have in our project template files, and they are located under the "Other" group. The Select BuiltIn Parameter Group node that ships with Dynamo is used to generate the needed value, but PG_OTHER is not on the list from which you select. The first item on the list, INVALID, might not seem like something you would want to select, but in this case, that is the correct choice, to have the parameters created placed under the Other category.

March 01, 2020

ACA: Sheet Keynote Symbols

The out-of-the-box Sheet Keynote symbol in the US Imperial content features a hexagonal "tag" (not a Schedule Tag, but a Block-type Multileader that has a User Block assigned to it).
If your office standard is to use a differently shaped symbol, for whatever reason, that can be done; just follow the instructions that follow.
  1. You will need a non-annotative block to serve as the User Block of the Multi-Leader. The block will need to have a non-annotative Attribute Definition to hold the Sheet Keynote value, along with whatever other graphics you need. The Multileader that gets inserted can be annotative, if so specified in the Multileader Style; the User Block needs to be set up such that 1" in the Block Definition will end up plotting at the AutoCAD Architecture Annotation Plot Size when plotted for the active annotation scale assigned to the Multileader. Assuming that you want the Sheet Keynote text to plot at the Annotation Plot Size, it needs to be 1" high. Size the additional graphics to suit.
  2. The Attribute Definition's default value needs to be set up with a Field, that is set to show the Sheet Key value (only), as shown in the image below. Set the Field category to AEC Keynotes, the Field names to Sheet Key only, the Format to Uppercase and check the Insert as a placeholder toggle. Your field expression should look like what is shown in the image.
  3. You will need a Block-type Multileader Style that has the leader set up the way you want for your Sheet Keynotes. The Multileader Style can be set up to use your User Block, if you like; even if you do not, the settings in the Tool Palette tool that will be created to insert the Sheet Keynote will take care of setting your block as the User Block.
  4. You can make the process of creating the block definition with the required Field easier, by placing an instance of the out-of-the-box Sheet Keynote in the file where you are going to create the Block Definition. For the US Imperial content, that will bring in the SheetKey_Hexagon_na Block Definition. Insert an instance of this Block Definition, select it, right click and choose Copy Block Definition and Assign from the context menu. Enter a new name for your block. Now edit the block in place. Keep the Attribute Definition as is, and edit the hexagonal Polyline, or erase it and replace it with your own graphics. Inserting an instance of the out-of-the-box Sheet Keynote will also bring in the Block (Straight Leader) Multileader Style (US Imperial content). If you like that leader style, use it. If not, make your own or rename the Block (Straight Leader) Multileader Style and then edit it to create the leader you want. Keep the type set to Block.
  5. Save the file that contains your Block Definition and Multileader Style in a location that will be accessible to everyone who will need to make use of the Tool Palette tool that will reference this content. A shared network location is ideal for this, but you can also set it up on a local drive if everyone has the same location.
  6. Create a Sheet Keynote type Tool Palette tool for your content, on an editable Tool Palette. You can either copy the out-of-the-box tool and edit its properties, or add a copy of the one called Sheet Keynote in the Stock Tool Catalog > Drafting Tools. NOTE: Setting up an editable tool palette, and then sharing it with others is beyond the scope of this article. Perhaps I should write about that in the future.
  7. Right click on the Sheet Keynote tool, and choose Properties from the context menu. Edit the tool's properties to suit your needs. Give the tool a meaningful Name, that clearly indicates that this is your Sheet Keynote tool. You can include an extended description in the Description property; this will be shown in the tool tip when a user hovers over the tool. To have the tool use your content, set the Multileader style location and Symbol location properties to the path/file that holds your content, and then choose your content using the drop-downs in the Multileader style and Symbol properties. Verify that the Content type property is set to Block. Set any other properties as you prefer.
  8. Select the OK button to ratify the changes you made to the tool's properties.
  9. Start a new drawing, and test the new tool by selecting it, and verify that it places your Sheet Keynote Multileader correctly. Make any adjustments to the content or the tool properties as needed. If you do not have any AEC Content in the file from which a Sheet Keynote can pull the Keynote reference, you can press the ENTER key when prompted to select an object, and then manually choose a Keynote in the Select Keynote dialog.
  10. Place several Sheet Keynote symbols in your file, then use the out-of-the-box Document > Annotation > Sheet Keynote Legend tool, selecting your Sheet Keynotes, to verify that they show in the legend.

February 01, 2020

ACA: Property for Area of a Hatch Object

A question regarding tagging Hatch objects and being able to display the area of the hatch arose the other day. My initial response was, sure, that should not be a problem in AutoCAD® Architecture. Upon actually trying to do that, I found that there is no Area Automatic Property for Hatches. While that seems like an oversight, I then checked the object properties of Hatches and found that there is an Area property that is available through ActiveX. That is, no doubt, what drives the Area property of Hatches in the Properties palette. So while it was not quite as easy as I originally thought, it is possible to do, by creating a Formula Property that extracts the Area of the Hatch object to which the Property's Property Set is attached. Here is how to do that:

  1. Open the Style Manager, and create a Property Set Definition that applies to Hatch objects. I called mine HatchObjects (demonstrating my incredible creativity), and will use that name in the balance of this article. If you already have a Property Set that applies to Hatch Objects, you can add the required properties to it. If you name yours differently, substitute your name for HatchObjects wherever you see it here.
  2. In the HatchObjects Property Set Definition, create an Automatic Property that references the Handle Automatic Property source, if one does not already exist. Select the Add Automatic Property Definition tool on the Definition tab of the HatchObjects Property Set Definition (second from the top, at the left side of the tab, with the lightning bolt icon). Select the toggle to the right of the Hatch source to put a check mark in it, then select the OK button. I chose to leave the name of the property at the default value of Handle.
  3. In the HatchObjects Property Set Definition, create a Formula Property.
  4. Enter a name for the property in the Name edit box at the top; I used HatchArea (creativity gone wild).
  5. Uncheck the Use formula for description toggle (unless you really want the formula to be the description; I almost never do).
  6. Enter the formula in the Formula edit box. If you like, you can cut and paste the formula from the code box below. Note that the [Handle] text has to be a properly created reference to the Handle Property created in Step 2. That is done by selecting it in the Insert Property Definitions pane in the lower left corner of the Formula Property Definition dialog. You can substitute that for the pasted text, or you can follow the instructions in this blog article, if you like.
    Set acadApp = GetObject(,"AutoCAD.Application")
    Set hatchObj = acadApp.ActiveDocument.HandleToObject( "[Handle]" )
    RESULT = hatchObj.Area / 144.0
    When done correctly, the [Handle] text will have a light gray background and will be treated as one item, not individual characters. See image of dialog below.
  7. The formula is setting the variable acadApp to the AutoCAD Application, and then getting the Hatch Object associated with the value of the Handle property (which is the Hatch Object to which the Property Set is attached). The RESULT of the formula is then set to the value of the Area property of the Hatch, which will be a real number representing the area of the Hatch, in square drawing units. My sample file used imperial units, with one unit equal to one inch. Since I wanted the Area value in square feet, I divided the raw value by 144.0 to get square feet. If you are not using imperial units, or want to show the Area in some other area unit, adjust the RESULT line to do what is necessary to get the area value in the desired units.
  8. Your Formula Property Definition dialog should look similar to the image below. If so, select the OK button to save the changes to the HatchArea Formula Property.
  9. Back in the Style Manager, on the Definition tab, assign the desired Property Data Format to the newly created Formula Property.
  10. If you need additional properties for your Hatch Objects, you can add them now. When done, select the OK button to accept the changes made, close the Style Manager and return to editing the drawing.
  11. Attach the Property Set to one or more Hatches in your file. Select the Hatch and note the value of the Area property (under the Geometry category) on the Design tab of the Properties palette. Then select the Extended Data tab and verify that the value shown matches (allowing for any rounding/formatting of the value by the chosen Property Data Format).