Gorilla Node - Pipe Placeholder by Points

New dynamo user here,

Can anyone give any direction on how to use this node? I don’t understand the “MEP Type” input. It needs an integer, but what do the numbers correspond to? This is from the Gorilla17 package.

1 Like

Have you tried clicking the link provided to the dynamo dictionary? It’s hard to tell what the author is after, especially since the api method doesn’t require the first input of this node :slightly_smiling_face:

I did try, the node doesn’t seem to be on there. It just takes me to this link that I’m assuming redirects to the homepage.

http://dictionary.dynamobim.com/#/Gorilla17/Placeholders/CreatePlaceholder/Action/PipePlaceholderbyPoints

What do you mean that the first input isn’t required?

Ah ok, it’s not easy if there’s no description :slightly_smiling_face:.

What I mean is, that the api call Im guessing the node is utilising, is this:

http://www.revitapidocs.com/2018.1/f291f914-aa0c-f6b0-c824-3fffe0191aba.htm

Do you have the MEPOver package installed? It might also have a node for pipe placeholder creation.

If all fails, then I can supply some python code that will get what you are after.

Wow that’s very generous of you to offer. After messing around I think it’s possible that inputting “0” will draw pipe placeholders and “1” will draw duct placeholders because I got an error about my system type not being an HVAC type when I entered “1” and had domestic water as my system type.

I am however getting a new error that doesn’t make sense to me considering it looks like my start and end points do not match:

I do have the MEPover package and it is great. Pipe.ByLines works perfectly, but there are no pipe placeholder nodes like it in the package. That’s how I ended up with this node. Basically I’m trying to do exactly what the Pipe.ByLines node does, except with pipe placeholders.

Hmm, if you do indeed have identical start and end points in you list, then Im afraid @T_Pover’s node will fail as well.

Minimal changes to the code in the pipe.bylines node could get you placeholders instead of pipes, but im not at a computer right now, so unless someone else catches this, then it will have to wait till tomorrow :slightly_smiling_face:

I’m more than willing to wait until tomorrow haha. I would try myself, but I have zero experience with python and coding in general.

The thing is that I’ve gotten these exact lines to work with the pipe.bylines node before. All I’m trying to do with the pipe placeholders node is break up those lines into a list of start points and a list of end points, which I thought I did successfully but apparently not. I’ll upload my dynamo file:

Pipe Placeholders from dwg.dyn (22.3 KB)

Thanks so much for offering to help!

Here you go:

The content of the python node:

import clr

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)


if isinstance(IN[0], list):
	lines = IN[0]
else:
	lines = [IN[0]]
	
FirstPoint = [x.StartPoint for x in lines]
SecondPoint = [x.EndPoint for x in lines]

if isinstance(IN[1], list):
	pipetype = UnwrapElement(IN[1])
else:
	pipetype = [UnwrapElement(IN[1])]
ptl = len(pipetype)

if isinstance(IN[2], list):
	systemtype = UnwrapElement(IN[2])
else:
	systemtype = [UnwrapElement(IN[2])]
stl = len(systemtype)
if isinstance(IN[3], list):
	level = UnwrapElement(IN[3])
else:
	level = [UnwrapElement(IN[3])]
ll = len(level)

elements = []

TransactionManager.Instance.EnsureInTransaction(doc)
for i,x in enumerate(FirstPoint):
	
	levelid = level[i%ll].Id
	systypeid = systemtype[i%stl].Id
	pipetypeid = pipetype[i%ptl].Id
		
	pipeplaceholder = Autodesk.Revit.DB.Plumbing.Pipe.CreatePlaceholder(doc,systypeid,pipetypeid,levelid,x.ToXyz(),SecondPoint[i].ToXyz())
	
	elements.append(pipeplaceholder.ToDSType(False))	

TransactionManager.Instance.TransactionTaskDone()


OUT = elements

Pipe Placeholders from dwg.dyn (46.7 KB)

Edit: Just swop change the inputs to your own. This was done with a test dwg in an empty Revit Project.

Edit 2: credit goes to @T_Pover of cause :grin::metal:

4 Likes

This worked perfectly! Thank you so much, I really appreciate it.

No probs :slight_smile: