Is there a way to change system type of a duct using the api?

Is there a way to change system type of a duct using the api?

waleed.hany
Contributor Contributor
1,103 Views
3 Replies
Message 1 of 4

Is there a way to change system type of a duct using the api?

waleed.hany
Contributor
Contributor

I am trying to change the system type of a ducts having "Undefined" system type using the revit api (C#). 
I tried :
var ele = e.get_Parameter(BuiltInParameter.RBS_DUCT_SYSTEM_TYPE_PARAM);
ele.Set(_pipeSystemTypeId); 
// _pipeSystemTypeId is the ElementId of the desired system type 

the problem is BuiltInParameter.RBS_DUCT_SYSTEM_TYPE_PARAM is readonly
Is there any other posible way to achieve this?
Thanks.

0 Likes
1,104 Views
3 Replies
Replies (3)
Message 2 of 4

sahin.ikbal
Advocate
Advocate

You can easily change system type of duct directly.

Through parameter read you can get which system type your duct is in.

You can combine both to manipulate system types of Ducts.
Just get System types through FilterElementCollection, then choose and give its id to below parameter.


2021-09-21_10-17-25.png

 

You are done.

0 Likes
Message 3 of 4

waleed.hany
Contributor
Contributor

Thanks Sahin.
I tried this approach, however not able to change it.

if (e is Duct)
{
Duct duct = e as Duct;

duct.SetSystemType(_selectedDuctSystemTypeId);
}

The result return is not changed

0 Likes
Message 4 of 4

waleed.hany
Contributor
Contributor

I think I got why it is not working.
First of all, I found that this method works for ducts not connected to other ducts in a system
the reason this method does not have effect if duct is connected is that its system type is driven by another element in the system.
Do you have any suggestion to resolve it?

0 Likes