This past week I have ran into a post on the DynamoBIM blog that was asking about an easier way to get profiles from Revit into Dynamo so that they can be used as Profiles while doing sweeps and extrusions like in this example by Eduardo Roca. As you can see Eduardo is going to some painstaking lengths to convert a profile into a PolyCurve that can be used with a Sweep node. As much as I like his write up I hate to do all of this manual labor of re drawing everything in Revit with model lines and then importing into Dynamo via Element Selection node.
In order to solve that problem I have created a node that queries a Profile Family and extracts its geometry (curves) while converting them to PolyCurves or Lists of Lists containing Curve segments as Lines or Arcs. This streamlines the process of creating a PolyCurve to creating a Profile Family and loading it into a project then selecting it using Family Types node in Dynamo.
The gist of this node is its geometry extraction that is done taking advantage of RevitAPI’s family management tools. When we create a Profile Family it is stored in that family’s document under Sketch class and then further under Profile as a CurveArray. The nice thing about that is that CurveArrays are nicely organized into lists of lists containing curves for each closed loop. That makes it much easier to convert to DS geometry and still keep nicely organized.
Here’s the code for this node:
Here’s an example of possible use for this node:
PolyCurve from Profile Family Type can be downloaded here.