Hi all
I am trying to create a flow arrow along the direction of pipe in python.I will select the pipe and flow arrow family using select model element and below is the code I am using.
Its creating the flow arrow somewhere but not at the center of pipe along the pipe direction.
can anyone help
The curve direction is going to tell you which direction the pipe was drawn, not the direction of the flow. You need to get the flow direction from the pipe connectors.
If that doesn’t do it for you we’ll need to see the input elements and the output from the python node, plus any errors or warnings that may be presenting.
Did you change your code to get the flow direction from the pipe connectors? Also, is the origin/orientation of your arrow family in the direction of the arrow?
but obviously arrow is just placed vertically as it is created inside the family. Annotation Symbol-Plumbing Flow Direction.rfa (384 KB)
my intension is not to get flow from pipe connectors. I want to place arrow in the diection of pipe direction or along the vector created from the start point and end point of pipe curve
pipe_vector = PLoc_EP.Subtract(PLoc_SP)
where
PLoc_EP is end point
PLoc_SP is start point @Nick_Boyts
Then you need to get the location and direction of the curve and then rotate the arrow to match. If the location seems off, you may have to adjust model coordinates. Dynamo uses the internal (origin) coordinate system, so if your model has been located using a different coordinate system (project or survey) you would need to account for that.
@Nick_Boyts
tried to find angle between Yaxis (Default orientation of flow arrow) and pipe vector .Then tried to rotate location of newly created flow arroe using the below code but getting an error saying expected line got xyz in the rotate method.
The Rotate() method requires a line defining the axis of rotation, not just a point. You can use the XYZ you have, extend another point in the Z direction, and use that to create a line.
@Nick_Boyts@Thomas_Mahon@c.poupin Can you test this script once. Everything seems fine but arrow family is not getting created . Revit and dynamo file is there in this wetransfer link
@jobinsunny99…If the arrow is placed somewhere else you can try to get the respective pipe’s center coordinates and again set those coordinates to the arrow family.
Since the arrow is an annotation, I believe that you will need to place it on the sketch plane for the view, otherwise it gets drawn out of range as you are seeing here. Clockwork has some nodes for creating detail components which can serve as the basis of how to do this.