December 29, 2017

ACA: Curved Mass Elements - Part 2: Shape Impact

First article in the series: ACA: Curved Mass Elements - Part 1: FacetDev and FacetMax

The Shape property of a curved Mass Element will affect how it reacts to the FacetDev and FacetMax settings. Any of the standard shapes that involve a curve, Arch, Barrel Vault, Cone, Cylinder, Dome, Doric and Sphere, will be initially placed based on the settings of FacetDev and FacetMax, and will update when changes to the FacetDev value would result in a different number of segments. A change to the value of FacetMax will not result in a change to the faceting of existing Mass Elements, even if it would cause a lesser or greater number of segments. The effect of a change to FacetMax on existing objects will be seen only if the value of FacetDev is subsequently changed by an amount sufficient to result in a different number of facets.

Mass Element Extrusions and Revolutions that have curves in the defining Profile will also retain the ability to change the number of facets when FacetDev is changed. Freeform Mass Elements, however, will have the number of facets present at the time of creation, regardless of later changes to the value of FacetDev. How can you end up with a Freeform Mass Element? The following will produce one:
  • Use of the Boolean tools to create Unions, Subtractions or Intersections of two or more Mass Elements that results in a shape that cannot be created by extruding a Profile placed in the X-Y plane in which the first object was created.
  • Use of the AecMassElementConvert command to convert an AEC object or an AutoCAD 3D Solid to a Mass Element. The Convert to Mass Element tool on the out-of-the-box Massing palette (in the Design tool palette group, in the US Imperial content, and, likely other content as well) runs this command. You can also access this command by selecting an AutoCAD 3D Solid, right clicking and chosing Convert to > Mass Element from the context menu.
  • Use of the ConvertMEToFFME command to convert an AutoCAD 3D Solid or a standard-shape Mass Element to a Freeform Mass Element. For standard-shape Mass Elements, this command can be invoked by selecting the Mass Element, right clicking and choosing Convert to > Freeform Mass Element on the context menu. NOTE: If you right click on one of the standard-shape tools on the Massing tool palette, and choose Apply Tool Properties to > Mass Element, the ConvertMEToFFME command will be run, but the 3D Solid or Mass Element will be converted into a Mass Element with the standard shape of the tool which was right-clicked.
In the images below, all three things started from the same source. At the lower left, there are the original objects: a Cylinder base and a Cone on top. In the middle, with FacetDev set to 20, with the Cylinder selected, Boolean > Union was selected from the right-click context menu, and then the Cone was chosen. The same operation was performed on the source objects in the upper right, but with FacetDev set to 0.5. In the top image, FaceDev is set to 0.5, and you can see that the facets on the Freeform Mass Element in the upper right match those of the Cylinder and Cone in the lower left, while the Freeform Mass Element in the middle retains the faceting that was current when it was created. For comparison, FacetDev is set to 20 in the lower image, and you can see that the faceting of the middle Freeform Mass Element matches that of the Cylinder and Cone in the lower left, while the faceting of the Freeform Mass Element in the upper right remains as it was at the time it was created.

December 27, 2017

Dynamo: Forcing Exactly One-Half to Round Up

In the same Dynamo graph on which my previous post was based, I had a need to round a real number to the nearest whole number, and I wanted a decimal of exactly .5 to round up. The Math.Round node met all my rounding needs except for when the decimal value is exactly 0.5; that node "rounds to even," which means that both 1.5 and 2.5 will round to 2, since 2 is even. Statistically, when dealing with a large amount of data, always rounding exactly 0.5 to even (or rounding always to odd) makes sense, as always rounding up would tend to skew any mathematical analysis of the data to a higher value. In this case, the number was being used only as a label, and I decided that it should always round up.

I put together the following nodes to achieve the desired results. Numbers in the explanation below refer to the numbers in the image. As always, you can click on the image to see the full-size version.

  1. This code block provides the source number to be processed.
  2. The nodes in Area 2 divide the source number by 100. In the example in the image, this results in a value of 12.5. This value is fed to the nodes in Areas 3, 4 and 5.
  3. The Math.Floor node truncates any fractional part in the value from Area 2, resulting in an integer of 12 in the example. This value is fed to the nodes in Areas 5 and 6.
  4. The Math.Round node takes the value from Area 2 and rounds it. For the example value of 12.5, the .5 is rounded to even, or 12. The result is a floating point number. This value is fed to a node in Area 7.
  5. The nodes in Area 5 take the value from Area 2 (12.5 in the example) and Area 3 (12 in the example) and subtract the Area 3 value from the Area 2 value. The result of the subtraction (0.5 in the example) is compared to the value in the Code Block, which is 0.5, by the == node. If the two are equal, the result of the comparison is true, as it is in the example; otherwise, it is false. This result is fed to the test input of the If node in Area 8.
  6. The Area 6 nodes take the integer result from Area 3 and add the value in the Code Block, or 1.0, to it. This is the rounded up value; it is 13 in the example.
  7. The two Math.Floor nodes in Area 7 take the real number results from Areas 4 and 7 and convert them to integers. These values were already whole numbers, but the Math.Round and + nodes output is a floating point number, not an integer. The application for which this rounding is being done required an integer. If it does not matter to your application whether the rounded number is a floating point number or an integer, these nodes would not be required. In hindsight, it occurs to me that one Math.Floor node could have been placed after the If node.
  8. The If node in Area 8 determines whether to use the result of the nodes in Areas 4 - 7 or Areas 3 - 6 - 7, based on whether Area 5 evalutes to true or false. If true, then the fractional part was exactly 0.5, and the rounded up value from Areas 3 - 6 - 7 is used. Otherwise, the rounded value from Areas 4 - 7 is used. This value will be rounded up for fractional values greater than 0.5 and down for fractional values less than 0.5.

December 25, 2017

Dynamo: Selecting All Curtain Walls

An opportunity to use Dynamo to create a string with which to tag Curtain Walls came up in a thread in the AUGI Revit Architecture - Families Forum. The first task for the Dynamo graph is to select all of the Curtain Walls in the Autodesk® Revit® project file. The All Elements of Category node, in combination with the Categories node, is the usual method for selecting all objects of a particular category in a project file, but there is no Curtain Walls category; you have to choose Walls as the category, and you get all of the Walls, including Basic Walls, Curtain Walls and Stacked Walls.

Thanks to the Filtering / Selecting Curtain walls thread in the Dynamo Forum, in particular, the third post by thread initiator Aseem Deshpande, I was able to use a modified version of what was shown in that post to generate a list of just Curtain Walls from the list of all Walls. (The code posted by Aseem Deshpande sought to remove the Curtain Walls, leaving only "opaque" Walls.) I too had used the Element.Parameter node to examine the available parameters and noted that the Family parameter held the information I needed to determine if a Wall was a Curtain Wall. Unfortunately, I also found that the Element.GetParameterValueByName node was returning the Type name, rather than the value of the Family parameter. The nodes in the post provide a way to make use of the Family parameter value to determine if a particular Wall is a Curtain Wall.

In the image below, the list of all Walls generated by the nodes in the image above, is fed to both the Element.Parameters node and the List.FilterByBoolMask node.
The Element.Parameters node takes the list of all Walls and creates a list of lists; each sub-list contains a list of the parameters attached to each Wall. The Parameter.Name node takes the list of lists of parameters and converts each parameter object to a string of the parameter name. That list of lists of parameter names is then fed to the List.FirstIndexOf node, which outputs a list of the index of the first occurrence of the string "Family" in each sub-list.

The List.GetItemAtIndex node takes the list of parameters lists and the list of indexes of the Family parameter to create a list of the Family parameters. The String from Object node converts each item on that list from a parameter and its value to a string. A code block then tests each string to see if it is equal to "Family : Curtain Wall", which is the value that will be present for Curtain Walls; the output is a list of True or False values, True representing Curtain Walls and False representing Basic or Stacked Walls. This list of Booleans is used as the mask input to the List.FilterByBoolMask node, and is applied to the list of all Walls. That node generates two lists, the "in" list contains all the "Trues", or Curtain Walls, and the "out" list contains all the "Falses". The "in" list is what I needed for the balance of that graph, a list of all of the Curtain Walls in the Revit project.

December 19, 2017

Downloading Autodesk Software

My go-to for downloading Autodesk software from the Autodesk site, the Autodesk Virtual Agent, has been retired, and if you go to that URL, you will, for the next forty-two days or so, find something that looks like this (with a reduced countdown time):

The good news is that the same functionality is still available, through AVA, the "new" Autodesk Virtual Agent. AVA is not really new; she has been around for some time now, answering general questions. What is new is now AVA can provide the download links that the old Virtual Agent provided. If you click on the "Launch AVA Now" link, you will be taken to AVA, pre-set for downloading. If you manage a number of users and find yourself frequently downloading installation files from the Autodesk site, bookmark that link. Or, you can go to the main link to AVA, and type in download as your first response to get Download A Product to show on the right side.