Hi everyone, Is there a way in Revit API to create a dash line and the angular dimension like when you draw something in Revit?
Simple answer is yes, but could you explain a little more? Your question is quite vague. Do you want to create those dimensions automatically whenever object is created or you just wish to select two objects and then script would place those dimensions?
As for dash line remember that you can always change properties of dimension type so it will look like you wish to:
This way whenever model changes you won’t need to remember about it, or there will be one less warning when constrains are broken
No, I don’t want to place dimensions. I’m trying to do a tool that allows the users to draw multiple pipes at once. It will prompt the user to select a point if this point is in the orientation of the pipes, it will be extended to this point. If the point has a different orientation, it will create the new pipes and then connect to the original pipes with elbows. So I want to display the dash line and angle like when I draw the pipe with the default command of Revit, because if I don’t display it, then sometimes the angle will be unusual (for example like 44.3, 42.1… degree) and there is no elbow with these angles in the real world.
In that case maybe you could ask user for inputing linebased family using:
However this method has it’s own transaction, also you will need to catch DocumentChanged events in order to retrieve created elements.
Sorry, I don’t get your point. I don’t want to place any family instances, I just want to display the dash line and angle when picking a point for the users to choose the angle of the elbows when they draw pipes.
I don’t think that it’s possible for Revit to find angular references when you are picking a point. New objects needs to have direction and connection to object you wish to measure to (otherwise it will dimension angle to main axes). What I proposed is workaround to this issue.
By the way, when I place pipes within my revit model I can see those dimensions, as long as you have loaded Pipe Fittngs family you should be able to use Revit stock solution with automatic fittings placement.
Hi @MarcinTalipski, thank you for the information. I’ll try it.