Hi,
When I use Revit ribbon drawing function, it is easy to create a tee fitting of any branch angle for pipe.
But when using NewTeeFitting method to do it, if the angle of branch is not 90 degree, then an InvalidOperationException throw. How can I create a tee fitting of not 90 degree branch angle for pipe by Revit API?
Best Regards,
Zhangzg
Solved! Go to Solution.
Solved by jlpgy. Go to Solution.
The failure may be caused by default fitting type after tee fitting creation, you can try to change the default fitting type to appropriate & desired fitting type.
Per my knowledge, the default fitting type is determined by routing preferences setting of pipe/duct/cabletray(you can refer to Revit SDK sample RoutingPreferenceTools on more details.), but I have no idea why it fail.
In order to explore this matter further, we will need to provide a minimal reproducible case for the development team to analyse in depth.
In order to understand exactly what you mean and be able to research possible reasons for the discrepancy between the observed and expected behaviour, they require:
· A short exact description of what you are trying to achieve.
· The behavior you observe versus what you expect, and why this is a problem.
· A complete yet minimal Revit sample model to run a test in.
· A complete yet minimal macro embedded in the sample model or Visual Studio solution with add-in manifest that can be compiled, loaded, run and debugged with a single click to analyse its behavior live in the sample model.
· Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
· http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
Hi JimJia,
Thank you so much for your reply.
I am sure the default fitting type is correct, because when using Revit ribbon drawing function, it works well. The 45 degree tee fitting created by Revit ribbon drawing function and the 90 degree tee fitting created by Revit API are the same fitting type.
When the branch is not 90 degree, for example 60 degree, I want to create the exact same degree(60) as the branch.
I doubt the "NewTeeFitting" API can't create a non-90 degree tee fitting.
Best Regards,
Zhangzg
Dear Zhigang,
Yet another point we have to consider is: please ensure the connector order is correct when calling NewTeeFitting API, you can find the connectors order in the family editing document.
Dear Zhigang,
Can you provide a reproducible case for it? I can help to forward this to engineering team to investigate.
Hi Zhang:
There is a property named as Angle in the class Connector. It has both get and set accessors.
U can calculate an valid angle value, disconnect the Tee slave element (pipe, etc.), set the Connector.Angle property to a new value, and then connect the Tee connector back to the slave pipe again.
U can use RevitLookup to inspect the Angle property before you get down to writing codes.
Notice that:
When you try to re-connect the Tee to the pipe again, you can use Connector.ConnectTo(), but this method sometimes leads to generation error when dealing with Conduit. For my own experience, I suggest using NewTransitionFitting() method. If two connectors are parallel, in opposite directions, with same sizes, and with same self-rotation, the NewTransitionFitting() method doesn't create a real transition fitting, but only connect two connectors.
I hope this helps. 🙂
Dear Yulong,
Following my understand, I have to take 3 step to create tee fitting with angle.
Step 1: Create tee with valid angle
Step 2: Modify angle to parallel with slave pipe.
Step 3: Extend the pipe by NewTransitionFitting()
But I'm stuck at step 1, how to create tee fitting with 2 connectors?
Hi,
you could create a dummy pipe which provides a valid third connector.
After creating your tee, delete this dummy pipe.
Revitalizer
Hi:
Yep! As @Revitalizer has already explained.
In our solution, we also create a perpendicular MEPCurve element with the same qualifications as the main Tee element. This temp element provide the third connector.
Be aware that you should calculate the cross point ahead to meke sure the Tee fitting will be located at the correct location.
Hi both,
After calculate the side of dummy and create NewTeeFitting, I've met 2 situations, that I don't know what's the correct Angle I have to set to connector.angle:
Case 1: set 45 degree to Angle
Case 2: or 135?
Both 2 case are correct. But I dont know how to find correct one.
Please advise. Thank you.
Hi:
It depends on the implementation of the Tee fitting family.
Suggest you double click the Tee fitting to open it's family document, and then check the angle parameter and inspect how it is bound to other parameters.
If you are using the default Revit libraries, and the default pipe fittings, I think it should be the angle between the connector3 and connector1. But I'm not quite sure. It totally depends on how the Tee fitting family is implemented, especially its parameter binding.
Hi,
I am having similar issues dealing with the angle of a Wye that i would like to insert in place of a Tee.
For my test i simply used the out of the box TEE and renamed it as a Wye, and tried to replace it using NewTeeFitting, but first i set my preferences to pick up the Wye family as default and not the Tee family.
i posted this here : https://forums.autodesk.com/t5/revit-api-forum/replace-a-family-instance-with-another-family-based-o...
Do you mind commenting on my code in the link above and give me some pointer on how you ended up dealing with it?
thanks
Have any of you tried connecting pipes with slopes to TeeFittings with angles? I have successfully implemented TeeFittings with angles using the aforementioned method. However, when attempting to connect pipes with slopes, I encountered a slight issue. The pipes connect successfully, and the slopes are correct. However, visually on the drawing, the pipe appears to be broken (it automatically connects when moving the TeeFitting). I have tried various methods and found that changing the pipe slope seems to cause this issue. I would like to understand why this problem is occurring. Below is my connection method: I use "PlumbingUtils.BreakCurve" to cut the main pipe -> generate a pipe perpendicular to the main pipe -> use "NewTeeFitting" to connect the main pipe with the previous pipe -> delete the perpendicular pipe -> change the angle of the TeeFitting -> connect the branch pipe.
Pink represents pipes with slopes, while gray represents pipes without slopes.
This is a shocking discovery that the default API does not allow for non-90-degree tees.
@tom.zhengGNS4G , were you able to resolve the issue? Maybe you could intentionally move the newly inserted fitting by a tiny fraction to prompt it to generate itself, as you mentioned that moving it will connect it properly.
I'm also curious - what happens if the branch also comes in at a 45-degree angle vertically? Meaning it has a large Z vector. Instead of changing just the angle property of the tee, is there a way to match the connector to the connector of the branch instead?
Can't find what you're looking for? Ask the community or share your knowledge.