Check Is Parallel with Margin

R22 Parallel lines.rvt (1.9 MB)

Hello all,
I need some help. Layer 5 lines look parallel to each other, but technically they are not.

By setting some margin, how can we generate the “true” result for the node “IsParallel”?

Except for lines of CAD layers 7 and 8, all other lines should be considered as parallel.
Thank you.


Recreate the vectors with rounded values based on whatever precision you need or get the angle between vectors and treat an acceptable range of values as parallel.

  1. Get the angle between the vectors with a Vector.AngleWithVector node.

  2. To account for start and end directions not being consistent we need to perform an extra action on angles greater than 90 degree - specifically we need to subtract the value from 180. This will get the ‘angle between’ the vectors instead of the angle to the second vector from the first. an if statement in design script as follows works well: angle > 90? 180 - angle : angle;

  3. The resulting angle between the elements can be used as a means of comparison - if the value is less than or equal to your desired tolerance they’re qualified as parallel. An <= node will do this well to identify these conditions as boolean values.

  4. From there you need to simply filter your original curves with a List.FilterByBoolMask node, and decide how to use the parallel and non-parallel lines.

Looks like this: