Filter if Pipes are Vertical?

Filter if Pipes are Vertical?

shicksMRENG
Explorer Explorer
2,599 Views
8 Replies
Message 1 of 9

Filter if Pipes are Vertical?

shicksMRENG
Explorer
Explorer

Hi all,

 

In my office, I am required to show the pipe/rise drop symbols both solid, and as a finer line weight than the piping system in many cases. For example, vent piping is shown as a hidden line and a thinner weight than sanitary or storm piping, and the rise/drop symbol takes on that pattern if I assign the piping system a hidden override, or if I assign the system abbreviation a filter.

 

My current solution is a yes/no parameter that allows me to determine if an instance of a pipe is vertical or not, and filtering by that. I don't know the first thing about Dynamo really, but it seems to me that I should be able to somehow sort by the Top Elevation, Middle Elevation, and Bottom Elevation parameters if not by the Slope Parameter. In pseudo-boolean terms, something like this;

"if(Top Elevation = Middle Elevation) or(Middle Elevation = Bottom Elevation)", check "Pipe is Vertical". I just want to automate this process as with large scale buildings, my current method is extremely tedious. Does anyone have a solution  to this? 


Thanks!

2,600 Views
8 Replies
Replies (8)
Message 2 of 9

djforemandesign
Advocate
Advocate

You could use Dynamo to select all conduit in your project and get the curve (center line) of each conduit. Then get the start and end point of each curve. 

If both the 'x' and 'y' values are the same for the curve then you know that segment of conduit is vertical.

 

You could then apply a value to a parameter or use a yes/no parameter like you mentioned. 

0 Likes
Message 3 of 9

djforemandesign
Advocate
Advocate

Here is a basic example of what you could do.  I'm selecting all the conduit in the current project. Then comparing the start and end points (x and y values) to see if they are the same. If they are then I add "Vertical" to the Comment parameter and if they aren't I add "Horizontal" to the Comment parameter.

 

Vertical Conduit Example - 3D.PNG

 

Vertical Conduit Example.png

 Vertical Conduit Example - Python.PNG

 

I personally used a Python node though its more advanced for a beginner (unless you are already familiar with Python), but it was quicker for me to do that then to use the nodes to do the same thing.

 

 

Here is the Python code if you want to copy/paste.

 

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

strpts = IN[0]
endpts = IN[1]
con_element = IN[2]

list_check = []

# Place your code below this line
q = 0
for point_1 in strpts:
	str_x = round(point_1.X,10)
	str_y = round(point_1.Y,10)
	end_x = round(endpts[q].X,10)
	end_y = round(endpts[q].Y,10)
	if str_x == end_x and str_y == end_y:
		list_check.append("VERTICAL")
		con_element[q].SetParameterByName("Comments","VERTICAL")
		q += 1
	else:
		list_check.append("HORIZONTAL")
		con_element[q].SetParameterByName("Comments","HORIZONTAL")
		q += 1
	
# Assign your output to the OUT variable.
OUT = list_check
Message 4 of 9

ssemashka
Explorer
Explorer

ssemashka_0-1674241441655.png

Any thoughts?

 

0 Likes
Message 5 of 9

JayHagan
Contributor
Contributor

All,

 

when attempting to run this, the following error appears: 

JayHagan_0-1699559572867.png

 

FYI, am a newbie when it concerns these programs.

0 Likes
Message 6 of 9

RLY_15
Advisor
Advisor

Please post the rest of the graph. You might be miswiring the IN[2] input (should be pulling from All Elements of Category) but I can't tell without the rest.

0 Likes
Message 7 of 9

JayHagan
Contributor
Contributor

Here is the Graph.

JayHagan_0-1699561918902.png

Thanks.

0 Likes
Message 8 of 9

RLY_15
Advisor
Advisor

robert2JCCH_0-1699563173884.png

 

0 Likes
Message 9 of 9

JayHagan
Contributor
Contributor

Awesome,  Thank-you that worked.

0 Likes