How to Code and Set Splitting Points for Element Splitting in Revit Secondary Development
When using the element splitting feature in code, the current approach relies on the built-in command PostableCommand.SplitElement. During execution, the user is prompted to select the splitting point, as shown in the image below. For pipelines, the connector automatically adjusts based on the splitting point to link the two resulting components.
However, the functionality we are developing aims to automatically split pipelines based on the floor plan elevation—without requiring user input to choose the splitting point. I would like to ask experienced developers if there is an API method that supports this automated splitting approach?
Solution:
The PickObject method includes an enumeration for object types, such as PointOnElement. Alternatively, you could list available elevations and allow the user to select an elevation at which to cut the pipe. Using the chosen elevation and the pipe’s line segments, the exact splitting point can be calculated. This approach enables you to determine splitting points programmatically based on elevation data.











Must log in before commenting!
Sign Up