Modifing spec on PipeBends usin C#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I can't find a way to modify the spec of a PipeBend entity using C#.
Based on the documentation and other components, a PipeBend is a PipeInlineAsset. This should mean that I can use RoutingHelper.SubstituteAsset(...) function.
The problem with this is that SubsituteAsset function request a parameter of a new block id which will be substituted.
Trying to get the block id became a challenge because there are no pipe bends inside the ContentManager. So from here I found that specs of pipebends are actually specs from a pipe.
This makes things much harder because when I'm trying to get the PartSizeProperties for a pipe and use this in SubstituteAsset function, I will get an Exception that is not documented.
Take a look at the following code:
ContentManager cM = ContentManager.GetContentManager();
ObjectId blockId = cM .GetSymbol(newProps, id.Database, Units.Mm);
PipeInlineAsset newPIA = new PipeInlineAsset();
newFitting.SymbolId = blockId;
PortCollection newPorts = newPIA .GetPorts(PortType.Static);
RoutingHelper.SubstituteAsset(id, newProps, newPorts, blockId);
newProps is PartSizeProperty object that contains all the information regarding to spec that I want to convert to.
Any tips will be appreciated! Thank you!