Geometry.SplitRecursively

Performing recursive actions with nodes is never easy. You usually have to resort to some form of a script. The below case is a good example of this. It uses Dynamo’s DesignScript language to recursively cut the resulting geometry over and over, until the list of cutting tools is exhausted. For a successful result, the cutting tools have to be sorted in the order of which the geometry should be cut.

 

dynamosandbox_2016-12-16_21-18-28

Inputs:

  • geometry: the solid or surface you’re trying to split
  • tools: the objects you’re trying to cut your geometry with, for example a list of planes or surfaces.
  • pickPoint: a point that is near the end of the cut tools and controls the direction of the cut.
Advertisements

DirectShape.ByGeometry, DirectShape.Transform

You are probably wondering what these DirectShape objects(refered to as DS from now on)  you’ve been seeing in the last few releases of Dynamo are all about and how are they any better than the built in “ImportInstance” SAT objects or family instances? Well here’s a brief summary:

  • They are very lightweight. They produce 3d geometry that is usually 20-30% smaller in size compared to conventional form based family instances.
  • DS objects belong to a category. This means that they can have type and instance based project parameters. They can also be scheduled or have rule based filters applied to them.
  • They can be transformed and translated incredibly quickly. Read on to find more about how to do that.

The “DirectShape.ByGeometry” node converts a Dynamo surface, poly-surface or solid into a Revit design script object type (which is a system type) and places an instance of that type inside your project, reflecting the geometry position from inside Dynamo. It currently supports Revit 2015 and 2016.

Revit_2016-02-18_23-45-14.png

The most important inputs are:

  • The geometry objects
  • A unique type name for each geometry object

The optional input is:

  • Category. The default value is Generic Model. Direct shapes have much less restrictions on categories compared to families.

Spring nodes’ DS implementation differs from the built in DS nodes in a few ways. The main difference is that this implementation produces smooth curved surfaces(similar to the SAT imports), instead of tessellated objects. This however comes at a price – you can not assign material properties to DS objects due the current restrictions in the Revit API.

The other major difference is that spring nodes’ DS objects have a type.This means you can assign type parameters to them and reuse the type’s stored geometry either by translating or transforming it. This can result in the quick generation of large compilations of complex geometry arrays. Let us build up on the previous graph:

Revit_2016-02-19_00-10-35.png

This graph manages to produce over 300 uniquely orientated, complex geometry elements in less than a second! Try to do that with any other Revit object.

The “DirectShape.Transform” node takes the following inputs:

  • a spring nodes typed direct shape instance
  • one or more coordinate systems

DirectShape sample 1.png

And the best part?explorer_2016-02-19_00-14-24.png

It does so by consuming just a few megabytes!

Once you’ve finalized your design, you can start populating the DS elements with different parameters and start scheduling them:

DirectShape schedule

You can not add any materials, but you can easily override their visual graphics representation or create rule based filters:

DirectShape filters.png

DS objects have both pros and cons. I personally see them as the perfect “temporary objects” or placeholder geometry in the early design stages of a project. Think of the possibility of creating tens or even hundreds of unique and lightweight design options that can coexist in a single Revit project. You’ll be able to quickly quantify and compare the different designs and once ready, send them along to the client in a nicely wrapped Revit file. Or if you are rushing for a deadline and do not have the time to create highly specific parametric content for an iteration that could very likely be thrown away by next week, you could quickly pop in a few DS elements and be good and ready.

Alternatively, imagine the following situation  –  you need to share your model with one of your biggest rivals. You have used hundreds of internal highly – parametric and intelligent families, that you’ve invested thousands of man-hours developing. You must  share all your geometry and data but you still want to keep your competitive advantage.Well, why not simply “freeze” some of your families by converting them to static DS objects? You’ll be able to transfer their entire parameter information and preserve the geometry without delivering your secret sauce to the competition on a silver platter. This sounds more sinister, but still could be a valid use for the DS nodes.

You can download this sample and others from the Spring Nodes repository:

https://github.com/dimven/SpringNodes/tree/master/Samples

Dimitar.

InterferenceCheck.Parse

Process a Revit interference check report (HTML file) and extract the clash types (the categories of the clashing elements), all clashing elements and the total number of clashes. To generate an interference report in Revit, go to Collaborate > Interference Check > Run Interference Check.

Revit_2016-01-31_20-45-03.png

Inputs:

  • report: a file path to the location of the report.
  • fetch_elements: a Boolean toggle (True by default). When true, the node will attempt to fetch the elements involved in each clash. For this to be successful, the node must be executed from the Revit document that the report originated from. If the element does not exist any more, a null value will be returned instead. If you are executing from a different document (or from Sandbox mode), be sure to set “fetch_elements” to False. This will give you the ID of each element as a string for easy documentation.

Outputs:

  • clash categories: all clashes in the report.
  • affected elements: the elements involved in each individual clash.
  • unique cases: each type of clash is listed here only once. Use this to filter in a specific type of clash (and thus its elements).
  • number of clashes: a count for each unique clash type and the sum of all clashes found in the report. Useful for documentation purposes.

The expected result when “fetch_elements” is set to False:

Revit_2016-01-31_20-45-32.png

An example on how to filter a specific type of clash and fetch only its elements:

Revit_2016-01-31_20-46-55.png

In very limited cases, a clash type may not be recognized successfully and will be categorized as “Unidentified”. Please report those cases to the repository.

ErrorReport.Parse

Process a Revit error report (HTML file) and extract the error types, all affected elements and the total number of errors.

Revit_2016-01-31_19-15-37.png

Inputs:

  • report: a file path to the location of the report
  • fetch_elements: a Boolean toggle (True by default). When true, the node will attempt to fetch the elements involved in each error. For this to be successful, the node must be executed from the Revit document that the report originated from. If the element does not exist any more, a null value will be returned instead. If you are executing from a different document (or from Sandbox mode), be sure to set “fetch_elements” to False. This will give you the ID of each element as a string for easy documentation.

Outputs:

  • error messages: all error messages in the report.
  • affected elements: the elements involved in each individual error.
  • unique errors: each type of error is listed here only once. Use this to filter in a specific type of error (and thus its elements).
  • number of errors: a count for each unique error type and the sum of all errors found in the report. Useful for documentation purposes.

The expected result when “fetch_elements” is set to False:

Revit_2016-01-31_19-16-12.png

An example on how to filter a specific type of error and fetch only its elements:

Revit_2016-01-31_20-05-28

Dictionary.ByKeysValues

Dictionaries are an incredibly powerful tool for making associative sets between two equal length lists. The first is a list of keys (or indexes) and the second – a set of values (or the data that will be returned for each index).

DynamoSandbox_2016-01-31_18-43-25.png

Inputs:

  • keys: it must consist of unique strings or numbers.
  • values: a value that will be returned for each key.
  • search keys: the list of keys(indexes) that you want returned.


Manipulate data, sculpt geometry, explore design options, automate processes by remotely accessing your visual programming environment on trending virtual PCs from CloudDesktopOnline.com powered by one of the best DaaS providers – www.Apps4Rent.com.

The dictionary values can hold lists of objects:

DynamoSandbox_2016-01-31_18-58-39.png

Or Revit elements:

Revit_2016-01-31_18-59-53.png

If a search key is not found in the dictionary, an empty list will be returned instead.

Sheet.Views+

 

2016-01-28_13-40-58.png

This node fetches all views and schedules placed on the input sheet(or sheets). The built-in sheet revision schedule is excluded.

Just like the “Active View” node, it’s a temporary band-aid until Dynamo supports all view types by default.

Active View

2016-01-28_12-18-07.png

Dynamo already provides nodes out of the box that can fetch the active view. Unfortunately they are not yet able to display some of Revit’s view types. Some of the views that the built-in solution can not currently handle are:

  • Sheet views
  • The Project Browser (yes it’s a view)
  • Legend views
  • Keynote legend views
  • Schedule views
  • Structural plan views (added in version 0.9)

“Active View” is a temporary solution to solve that problem. Once support is added for all view types, this node will be depreciated from the package.

Spring Nodes Node Index

This page will be updated as more content is added to DynamoNodes.

You can find a detailed change log here.

Active View
AdaptiveFamily.ByFacetedGeometry
AreaPlan.ByLevelName
Beams.FixExtents
BoundingBox.Scale
ClosedCurve.Offset+
Collector.CurrentSelection
Collector.ElementsInView
Collector.ElementSketch
Collector.FamilyInstances
Collector.FamilyTypes
Collector.FloorTypes
Collector.LinkedInstanceElements
Collector.Revisions
Collector.Sheets
Collector.Views
Collector.WallTypes
Color2Decimal
Curve.Offset+
CurveLoop.Simplify
Decimal2Color
Dictionary.ByKeysValues
DirectShape.ByGeometry
DirectShape.Transform
DirectShape.Translate
Doc.DeleteElements
Element.AddVoidCut
Element.Copy
Element.IsCut
Element.IsCutting
Element.RemoveVoidCut
Element.SetLocation
ErrorReport.Parse
FamilyInstance.ByGeometry
FamilyInstance.Rotation
FamilyType.Duplicate
Feet2Fraction
File.Size
Filter.ByCategoryName
Filter.ByClassName
Filter.BySelection
FloorOpening.ByCurves
FloorType.Duplicate
Floor-WallType.SetMaterial
Fn.ElementsOfCategory
Form.ByGeometry
Fraction2Feet
Geometry.SplitRecursively
HostedInstance.ByPoints
Input.Wait
InterferenceCheck.Parse
Line.StraightenXY
Line.StraightenZ
Lines.Group&FixCorners
List.DragDropReorder
List.DropDown
List.DropFirstLast
List.DropLast
List.EveryOther
List.GetEven
List.GetOdd
List.MergeByBoolMask
List.Randomise&Divide
List.ShiftIndices+
List.Split
Ln2Str
List.Subpairs
Math.AlmostEqual
N-hedron.ByOriginVector
NullAllIndicesOf
NullGetParameter
NullIndexOf
NullReorder
NullSetDifference
NullSetParameter
Number.ToString
Object.Class
PlanarFace.FixDomain
Point.PullOntoPlane
Pt2Str
PolyCurve.Chamfer
Polygon.ContainmentTest+
Select Edges
Select Elements (ordered)
Select Linked Element
Select Linked Elements
Select Linked Elements (ordered)
Select Linked Face
SelectInRevit
Shaft.ByCurves
Sheet.Views+
Star.ByCenterRadiusRays
Str2Ln
Str2Pt
Topography.ToPolySurface
ViewSet.ByViewsName
Wall.WallType
WallType.Duplicate
Watch+

What is Spring Nodes?

spring nodes logo.jpg
Spring Nodes’ main focus is to improve Dynamo’s interaction with Revit. It’s wider goal is to explore any and all means that can help accelerate BIM focused work-flows. Many of the nodes use either IronPython or DesignScript and can be a good starting point for learning the specific syntax and finer points of both.

The package repository is posted on GitHub under the MIT license. You will also find all the sample files and brief descriptions there, that can further demonstrate how some of the nodes work.

Nobody likes squeaky springs. Therefore your recommendations and ideas on how to improve this package further are always welcome. Please be sure to report any issues or feedback directly to the repository.

Some of the nodes provided in this package have been sprung by existing content, such as the wonderful SteamNodes, archi-lab.net, Clockwork and LunchBox, because every great mechanism could use a spare spring from time to time. The aim is to always improve upon the original content either by enabling additional functionality or opening up new uses. By giving it a new twist, we avoid affecting the original content’s goals and direction.

 

FamilyInstance.ByGeometry

This node converts a Dynamo surface, poly-surface or solid into a Revit family. It then places an instance of that family inside your project, reflecting the geometry position from inside Dynamo. It currently supports Revit 2014 to 2016.

Revit_2016-01-12_21-53-47.png

The most important inputs are:

  • The geometry objects
  • A file path to a family template (It is crucial that the family template version matches your Revit version)
  • A unique family name for each geometry object

The optional inputs are:

  • Category. The default value is Generic Model. Some templates, like the conceptual mass, do not allow changes to the family category. In those cases the built-in category will remain in force.
  • Material of the family, provided as a string. The material must be pre-loaded into the template for this option  to take effect. If a material with such a name does not exist in the template, the default “By Category” material will be used.
  • Void switch provided as a Boolean ( true / false). The default value is set to false. If you provide a true value, the newly created family will act a void cut element and will be able to perform cuts on  structural elements, generic model elements and host elements.
  • Subcategory provided as a string. The default value is null – meaning that this option is ignored. If you provide a subcategory name, it will be generated inside the family document, applied to the family and added to the project together with it.

 

Revit_2016-01-12_22-21-28.png

Do note that by default, the node works in “longest” lacing. That means that if any of the optional inputs are less than the geometry objects and the family names, the last input will be used for all remaining families. In the above image, the families at [6] and [7] will belong to the “Generic Model” category and will act as void cuts.

You can download this sample and others from the Spring Nodes repository:

https://github.com/dimven/SpringNodes/tree/master/Samples

Currently the node does not place multiple geometries into a single family. There is a partial workaround described in the following discussion:

https://github.com/dimven/SpringNodes/issues/10

A node for such cases might be developed in the future.