Hi,
I've done some searching but not turned up anything that describes how to set a pipe place holder system type.
Something like
Pipe pipe = Pipe.CreatePlaceholder(doc, pst.mPipeType.Id, s.mRevitLevel.Id, p, c);
Parameter prm = pipe.get_Parameter(BuiltInParameter.RBS_PIPING_SYSTEM_TYPE_PARAM);
if (prm != null)
prm.Set("Domestic Cold Water");
creates the placeholder, but system type is left "UNDEFINED".
Thanks in advance,
Jon
Ability to set the piping system type via the API if the pipe was created via the API is not supported at this moment.. I am not aware of any workaround that I can suggest unfortunately.
Sorry about that.
Wow. When might we expect to be able to have this type of functionality provided?
I can't change the type manually on the created objects making them impossible to use. Can you advise if this is possible?
Dear Jon,
Thank you for your query.
I agree that this is pretty fundamental.
Unfortunately, the functionality you ask for is not currently available directly.
It is probably possible to work around this lack pretty easily in Revit 2014 using the new copy and paste functionality.
We have an existing wish list item 217278 [Wishlist: Ability to set the piping system type via the API if the pipe was created via the API] for this. I added a note of your request to this item in order to make the development team aware of its importance.
I hope this helps.
Best regards,
Hi Jeremy,
Thanks for the reply. I look forward to seeing this type of functionality implemented in the Revit API.
I have requests and interest in generating building services models from the API, so when work is being done on this area it would be great if I could be involved in "beta-testing" this to avoid the situation where this aspect is fixed, but a new one arises (that I can't test until an official release occurs) slowing the progress of what could be a very powerful workflow.
Cheers,
Jon
Hi Jon.
Great! Well, as an ADN member, you are notified and invited to participate, aren't you?
Cheers,
Jeremy
It's true. I just thought perhaps it could be noted on the case so I could be notified when this is worked on (I assume it will happen anyway as I opened the ADN case).
Dear Ning and Jon,
Thank you for your update. Yes, something has has indeed happened in the meantime.
Ning, you mention the old SPR #217278 [Wishlist: Ability to set the piping system type via the API if the pipe was created via the API].
Please always keep track of the numbers of these issues, since they provide our main key for tracking them. The descriptions are editable and sometimes change.
I have dealt with two other ADN cases related to this topic, 08281195 [MEP pipes and placeholders assign system type] and 09691948 [Unable to change a duct's System Type in an Add-in].
The old SPR has been migrated to a new system and evolved into REVIT-28762 [API bug calling Pipe.Create].
I am telling you this mainly for my own sake, to simplify future tracking purposes.
Interestingly enough, the latter has been closed and marked as 'Works As Expected'.
Here is the case history of this issue:
[Q] I am unable to determine a valid argument to pass in as a piping system type to Pipe.Create. Is it possible at all? Sample code and further discussion is provided by The Building Coder:
[A] I looked at the code in "The Building Code" about Pipe.Create.
In 2014, we provided the new static Pipe.Create method to create the pipe taking six arguments:
The systemTypeId is to let user choose which system type the new create pipe belongs to, such as 'Hydronic Supply'/Sanitary etc.
The old document.NewPipe has no systemTypeId parameter, so the new created pipe will use the default system type (Hydronic Supply).
In the page, you called: ElementId idSystem = pipe.MEPSystem.Id;
This is not system type id, but system id.
You should call : ElementId systemTypeId = pipe.MEPSystem.GetTypeId();
In 2015, we provided another 2 Pipe.Create static functions.
create( Document, ElementId pipeTypeId, ElementId levelId, Connector startConnector, XYZ endPoint );
Note: if you want the start point connect to one existing element, just need to pass the connector of the existing element as 'startConnector'.
create( Document, ElementId pipeTypeId, ElementId levelId, Connector startConnector, Connector endConnector );
Note: If you want the newly created pipe to connect to two existing elements, you can pass two connectors of the exisitng elements as 'startConnector' and 'endConnector'.
In your article 'Creating a Rolling Offset Pipe Between Two Pipes', I would suggest you to use the third pipe.Create.
BTW: the two new Revit 2015 pipe.Create overloads take no systemTypeId, because the newly created pipe will have same system type as the connected elements.
You also can create your own system types. E.g., for a pipe, you ccould do so by calling PipingSystemType.Create.
From this, you can determine the system type id from the new created system system type element.
Does this solve your problem?
As far as I can tell, it looks like the new Pipe.Create function can solve your problem.
Could you please have a try and let us know if you have any further question on this?
Thank you!
I hope this helps.
Best regards,
Jeremy
Please share some sample code making use of this, if it wokrs.
Also if not, so we can explore further.
Thank you!
Cheers,
Jeremy
Dear Ning,
Thank you for the update. I am checking with the development team.
Cheers, Jeremy.
Dear Ning,
Thank you for your patience. I heard back from the development team. They say:
Changing the system type of things in the UI is possible sometimes, and other times not. Further, changing the system type can have broader reaching impact, that may or may not be desirable. It is probably one of the more complicated concepts in Revit. Even if it was possible, it would still be loaded with caveats that would be reflected in the API and may still make this a difficult question to answer.
One workaround that may be feasible (though also has undesirable effects in some cases) is to delete the system, route a new element of the target system to the existing elements, and then delete any un-needed elements that may be added in the process. The undesirable side effect here is that this can cause, for example, a return connector on a component (such as an air terminal) to be associated to a Supply system.
I hope this clarifies.
Cheers,
Jeremy
I'm struggling to create new pipes disconnected from any existing system via the API. I can create them with a SystemTypeId (generated in the API) and attach to them, but they still all say undefined in Revit.
PipingSystem pipeSysWet = PipingSystem.Create(doc, PipingSystemType.Create(doc, MEPSystemClassification.FireProtectWet, "WetPipe").Id); pipe = Pipe.Create(doc, pipeSysWet.GetTypeId(), newPipeType.Id, level.Id, start, end);
Is there more about the PipingSystem that needs to be defined for it to work?
David Timm
Can't find what you're looking for? Ask the community or share your knowledge.