Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pipe placeholder set system type

15 REPLIES 15
Reply
Message 1 of 16
GeomGym
3669 Views, 15 Replies

Pipe placeholder set system type

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

Tags (3)
15 REPLIES 15
Message 2 of 16
saikat
in reply to: GeomGym

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.
 



Saikat Bhattacharya
Senior Manager - Technology Consulting
Message 3 of 16
GeomGym
in reply to: saikat

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?

Message 4 of 16
GeomGym
in reply to: GeomGym

Is it possible to generate pipes with types (not place holders)?

Message 5 of 16
jeremytammik
in reply to: GeomGym

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,



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 6 of 16
GeomGym
in reply to: jeremytammik

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

Message 7 of 16
jeremytammik
in reply to: GeomGym

Hi Jon.

 

Great! Well, as an ADN member, you are notified and invited to participate, aren't you?

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 16
GeomGym
in reply to: jeremytammik

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).

Message 9 of 16
Ning_Zhou
in reply to: jeremytammik

is that [Wishlist: Ability to set the piping system type via the API if the pipe was created via the API] being realized in 2015 Jeremy? i havn't use 2015 yet, manually changing system type (for both pipe and duct) is such a pain in the a**!
Message 10 of 16
jeremytammik
in reply to: Ning_Zhou

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:

 

http://thebuildingcoder.typepad.com/blog/2014/01/creating-a-rolling-offset-pipe-between-two-pipes.ht...

 

[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:

 

  • document: The document.
  • systemTypeId: The id of the piping system type.
  • pipeTypeId: The id of the pipe type.
  • levelId: The level id for the pipe.
  • firstPoint: The first point of the pipe.
  • secondPoint: The second point of the pipe.

 

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 11 of 16
jeremytammik
in reply to: jeremytammik

Please share some sample code making use of this, if it wokrs.

 

Also if not, so we can explore further.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 12 of 16
Ning_Zhou
in reply to: jeremytammik

thanks Jeremy for your detailed solution to my "question", very appreciated.

good to know that API is available to create system type, i noticed that i raised wrong question, sorry about it, my real question is:
instead of creating system type, for existing pipe / duct, is it possible to change from system type A to system type B, assuming both system A and B already exist?

for 2014, i checked w/ lookup tool, all related parameters (system
classification / type / name / etc.) are read-only, not quite sure for 2015.
Message 13 of 16
jeremytammik
in reply to: Ning_Zhou

Dear Ning,

 

Thank you for the update. I am checking with the development team.

 

Cheers, Jeremy.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 14 of 16
jeremytammik
in reply to: Ning_Zhou

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



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 15 of 16
Ning_Zhou
in reply to: jeremytammik

thanks Jeremy, i do agree that changing the system type can have broader reaching impact, i'll try workaround even though it's also risky.
Message 16 of 16
david.timm
in reply to: jeremytammik

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.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community