Dynamo
Primer for v2.0
English
English
  • About
  • Introduction
    • What is Dynamo & How Does It Work?
    • Primer User Guide, Dynamo Community & Platform
  • Setup for Dynamo
  • User Interface
    • Workspace
    • Library
  • Nodes and Wires
  • Essential Nodes & Concepts
    • Index of Nodes
    • Geometry for Computational Design
      • Geometry Overview
      • Vector, Plane & Coordinate System
      • Points
      • Curves
      • Surfaces
      • Solids
      • Meshes
    • The Building Blocks of Programs
      • Data
      • Math
      • Logic
      • Strings
      • Color
    • Designing with Lists
      • What's a List
      • Working with Lists
      • Lists of Lists
      • n-Dimensional Lists
    • Dictionaries in Dynamo
      • What is a Dictionary
      • Dictionary Nodes
      • Dictionaries in Code Blocks
      • Revit Use-Cases
  • Custom Nodes & Packages
    • Custom Nodes
      • Custom Node Introduction
      • Creating a Custom Node
      • Publishing to Your Library
    • Packages
      • Package Introduction
      • Package Case Study - Mesh Toolkit
      • Developing a Package
      • Publishing a Package
      • Zero-Touch Importing
  • Dynamo for Revit
    • The Revit Connection
    • Selecting
    • Editing
    • Creating
    • Customizing
    • Documenting
  • Dynamo for Civil 3D
    • The Civil 3D Connection
    • Getting Started
    • Node Library
    • Sample Workflows
      • Roads
        • Light Pole Placement
      • Land
        • Service Placement
      • Utilities
        • Rename Structures
      • Rail
        • Clearance Envelope
      • Surveying
        • Point Group Management
    • Advanced Topics
      • Object Binding
      • Python and Civil 3D
    • Dynamo Player
    • Useful Packages
    • Resources
  • Dynamo in Forma Beta
    • Set Up Dynamo Player in Forma
    • Add and Share Graphs in Dynamo Player
    • Run Graphs in Dynamo Player
    • Dynamo compute service differences with Desktop Dynamo
  • Coding in Dynamo
    • Code Blocks and DesignScript
      • What's a Code Block
      • DesignScript Syntax
      • Shorthand
      • Functions
    • Geometry with DesignScript
      • DesignScript Geometry Basics
      • Geometric Primitives
      • Vector Math
      • Curves: Interpolated and Control Points
      • Translation, Rotation, and Other Transformations
      • Surfaces: Interpolated, Control Points, Loft, Revolve
      • Geometric Parameterization
      • Intersection and Trim
      • Geometric Booleans
      • Python Point Generators
    • Python
      • Python Nodes
      • Python and Revit
      • Setup Your Own Python Template
    • Language Changes
  • Best Practices
    • Graph Strategies
    • Scripting Strategies
    • Scripting Reference
    • Managing Your Program
    • Efficiently Working With Large Data Sets In Dynamo
  • Sample Workflows
    • Getting Started Workflows
      • Parametric Vase
      • Attractor Points
    • Concept Index
  • Developer Primer
    • Build Dynamo from Source
      • Build DynamoRevit from Source
      • Managing and Updating Dependencies in Dynamo
    • Developing for Dynamo
      • Getting Started
      • Zero-Touch Case Study - Grid Node
      • Executing Python Scripts in Zero-Touch Nodes (C#)
      • Going Further with Zero-Touch
      • Advanced Dynamo Node Customization
      • Using COM (interop) types in Dynamo Packages
      • NodeModel Case Study - Custom UI
      • Updating your Packages and Dynamo Libraries for Dynamo 2.x
      • Updating your Packages and Dynamo Libraries for Dynamo 3.x
      • Extensions
      • Defining Custom Package Organization for Dynamo 2.0+
      • Dynamo Command Line Interface
      • Dynamo Integration
      • Developing For Dynamo For Revit
      • Publish a Package
      • Build a Package from Visual Studio
      • Extensions as Packages
    • Pull Requests
    • Testing Expectations
    • Examples
  • Appendix
    • Frequently Asked Questions
    • Visual Programming and Dynamo
    • Resources
    • Release Notes
    • Useful Packages
    • Example Files
    • Host Integration Map
    • Download PDF
    • Dynamo Keyboard Shortcuts
Powered by GitBook
On this page
  • Goal
  • Key Concepts
  • Version Compatibility
  • Dataset
  • Solution
  • Get Corridor Data
  • Generate Coordinate Systems
  • Transform Block Geometry
  • Generate Solids
  • Output Solids to Civil 3D
  • Result
  • Ideas
Edit on GitHub
Export as PDF
  1. Dynamo for Civil 3D
  2. Sample Workflows
  3. Rail

Clearance Envelope

PreviousRailNextSurveying

Last updated 1 year ago

Developing kinematic envelopes for clearance validation is an important part of rail design. Dynamo can be used to generate solids for the envelope instead of creating and managing complex Corridor subassemblies to do the job.

Goal

Key Concepts

  • Working with Corridor Feature Lines

  • Transforming geometry between Coordinate Systems

  • Creating solids by lofting

  • Controlling node behavior with lacing settings

Version Compatibility

This graph will run on Civil 3D 2020 and above.

Dataset

Start by downloading the sample files below and then opening the DWG file and Dynamo graph.

Solution

Here's an overview of the logic in this graph.

  1. Get Feature Lines from the specified Corridor Baseline

  2. Generate Coordinate Systems along the Corridor Feature Line at the desired spacing

  3. Transform the profile Block geometry to the Coordinate Systems

  4. Loft a solid between the profiles

  5. Create the solids in Civil 3D

Let's go!

Get Corridor Data

Our first step is to get Corridor data. We'll select the Corridor model by its name, get a specific Baseline within the Corridor, and then get a Feature Line within the Baseline by its point code.

Generate Coordinate Systems

What we're going to do now is generate Coordinate Systems along the Corridor Feature Lines between a given start and end station. These Coordinate Systems will be used to align the vehicle profile Block geometry to the Corridor.

If Coordinate Systems are new to you, take a look at the Vector, Plane & Coordinate System section.

  1. Notice the little XXX in the bottom-right corner of the node. This means that the node's lacing settings are set to Cross Product, which is necessary to generate the Coordinate Systems at the same station values for both Feature Lines.

If node lacing is new to you, take a look at the What's a List section.

Transform Block Geometry

Now we need to somehow create an array of the vehicle profiles along the Feature Lines. What we're going to do is transform the geometry from the vehicle profile Block definition using the Geometry.Transform node. This is a tricky concept to visualize, so before we look at the nodes, here's a graphic that shows what is going to happen.

So essentially we're taking the Dynamo geometry from a single Block definition and moving/rotating it, all while creating an array along the Feature Line. Cool stuff! Here's what the node sequence looks like.

  1. This gets the Block definition from the Document.

  2. These nodes get the Dynamo geometry of the Objects within the Block.

  3. These nodes essentially define the Coordinate System that we are transforming the geometry from.

  4. And finally, this node does the actual work of transforming the geometry.

  5. Note the Longest lacing on this node.

And here's what we get in Dynamo.

Generate Solids

Good news! The hard work is done. All we need to do now is generate solids between the profiles. This is easily accomplished with the Solid.ByLoft node.

And here's the result. Remember that these are Dynamo solids - we still need to create them in Civil 3D.

Output Solids to Civil 3D

Our final step is to output the generated solids into Model Space. We'll also give them a color to make them very easy to see.

Result

Here's an example of running the graph using Dynamo Player.

If Dynamo Player is new to you, take a look at the Dynamo Player section.

Ideas

Here are some ideas for how you could expand the capabilities of this graph.

Add the ability to use different station ranges separately for each track.

Split the solids into smaller segments that could be analyzed individually for clashes.

Check to see if the envelope solids intersect with features and color those that clash.

Use a vehicle profile Block to generate clearance envelope 3D solids along a Corridor.

Mission accomplished!

🎯
🎉
188KB
Rail_ClearanceEnvelope.dyn
22MB
Rail_ClearanceEnvelope.dwg
Selecting the Corridor, baseline, and feature line
Getting Coordinate Systems along the Corridor Feature Lines
A visualization of transforming geometry between Coordinate Systems.
The vehicle profile Block geometry after transforming
The Dynamo solids after lofting
Outputting the solids to Civil 3D
Running the graph using Dynamo Player and seeing the results in Civil 3D