I have big drawing firefighting need taging to all pipe once. But tag going on all pipe. I try to make vertical and horizantaly seprate and on top view b & c also want seprate selection behavior example is image. Mention
In drawing i have 3 types pipe a is rizer b is top view but 180 degree and c is 90 degree direction.
How i make 3 option for 3 type slection
Can you guide me fore coding or .dyn
- Take all the pipes.
- Get the pipe’s location curves.
- Get the direction of each pipe’s curve using a Curve.TangentAtParameter node with a parameter value of 0.5.
- Pull the Z component of each vector using a Vector.Z node.
- Test that Z value for not being equal to 0 with a != node.
- Use an If node to return a value of “vertical” if true, otherwise return null.
- Pull the X and Y components of the vectors in step 3 (Vector.X and Vector.Y nodes).
- Get the absolute value of the X and Y values with a pair of Math.Abs nodes.
- Test the absolute value of X against the absolute value of Y with a >= node.
- Use an if node to return “X primary” if true, or “Y primary” if false.
- Join the two tests (step 6 and step 10) together into one list.
- Use a List.Transpose to put the entirety of each pipe’s tests into a single list.
- Use a List.Clean node with a ‘false’ input to the preserve indices to remove any null values.
- Use a List.FirstItem node with the List level set to @L2 to get the first value out of the list.
- Use a List.GroupByKey node to group each of the pipes (step 1) by their primary direction (step 14).
- Create a dictionary of the groups, using the keys as the dictionary value. This will ensure that you can call for the Vertical, X primary or Y Primary as desired, even if a direction wasn’t present (ie: there are no vertical pipes in the original selection).
- Proceed to tag each pipe type as desired using your tag automation of choice.
This thing very hard for me.
Today i get something like this but i want this horizantal two different directions in seprate.
Image and dynmo. Attached.
Horizantal or Vertically pipe Selection.dyn (22.1 KB)