Dear Maxime,
Thank you for your request.
Many thanks to Harry Mattison of Boost your BIM, Revitalizer and Xiaodong for the workaround!
Sorry to hear it has those flaws.
We used to have a Revit API development wish list item CF-802 [API wish: split duct or pipe like 'Split Elements' command]:
Request: I would like to split a Duct or a Pipe in a way that retains the intact Revit functionality.
The user interface provides a command to split walls via Modify > Split Element > Split with Gap.
How can I programmatically achieve something similar to split a duct or a pipe?
The 'Split Element' command that does work for Ducts and Pipes.
You suggest to remove the taps and then recreate them. In the UI, the extend method will only create the tap again if it is also defined in the DuctType and if the Preferred Junction Type is set to Tap. Furthermore, another thing that needs to be taken into account is that certain parameters might be set for the duct or pipe. and all of these parameter values will need to be copied to the newly created segment as well.
The function 'Split Elements' provided by the user interface does all of this automatically: it will just split the Duct and add a union family in between. That is exactly what I would like to achieve programmatically as well.
The development team replied:
Our internal method for splitting the MEP curve is wrapped pretty well. Please log an API request if the MEP curve split is a frequent customer need. Similarly, for setting the duct/pipe end positions, especially for a new unconnected curve.
I notice our UI does not support “Split with GAP” for ducts/pipes. For walls, the two split walls remains locked even if they are physically separated. That would be something unavailable to pipes/ducts.
According to the comments on that wish list item, it was implemented and closed with resolution 'fixed' in the Revit 2017 timeframe.
I do see the BreakCurve method in the API, but unfortunately only for pipe and duct curves:
https://apidocs.co/apps/revit/2019/3c302b80-d1f8-0e17-154a-b809cad2e545.htm
Consequently, I logged a new issue CF-4916 [API wish: split wall like 'Split with gap' -- 14929026] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.
You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.
This issue is important to me. What can I do to help?
This issue needs to be assessed by our engineering team and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:
- Impact on your application and/or your development.
- The number of users affected.
- The potential revenue impact to you.
- The potential revenue impact to Autodesk.
- Realistic timescale over which a fix would help you.
- In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.
This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.
Best regards,
Jeremy