I would like to create a connector from a reference plane. CreatePipeConnector function requires a PlanarFace. Is there another function or how can I transform a ReferencePlan into PlanarFace?
Thank you.
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
The ReferencePlane documentation sample code shows how to call GetPlane to retrieve the DB Plane:
https://www.revitapidocs.com/2020/e7003ec7-1dbe-50a2-fb3d-a83a5a3b5b9f.htm
More to the point, the the CreateAirHandler SDK sample to how to use the CreatePipeConnector method.
When in doubt about how to call a Revit API method, one of the first places to always consult is the collection of Revit SDK samples. That step often helps and may save time and effort for you and others.
Hi Jeremy. Thank you for your response.
I try several codes without success.
I would just like to do these with the API :
Thank you again for your help.
Have you looked at the approached used by the CreateAirHandler SDK sample?
I looked the CreateAirHandler SDK sample example. But, if I understood correctly, it created the connectors from an extruded volume. So there are planar faces available.
Good. I see your point. Such situations arise regularly. You do have a real existing surface somewhere in the model that you can mount your connector on, don't you? Otherwise, you are modelling something that cannot be built. The existing surface is part of some BIM element geometry. You can identify the appropriate element and retrieve its geometry from the document by calling its Geometry property and providing an Options object with ComputeReferences set to true. Then, iterate through all its surfaces to identify the one you need. Et voila, that surface is equipped with a reference that you can use to create the connector.
I hope this helps.
Best regards,
Jeremy
Hello. I was a bit long, but what you told me inspired me to think about it. I am creating a converter. And so I create automaticly families from basic geometric shapes. To add, my connectors that do not rest on one face, I artificially added a cylinder that I masked where I wanted a connector. Here's what I get :
Thank you so much.
Best regards,
Edouard
Can't find what you're looking for? Ask the community or share your knowledge.