3DPolyLine by CogoPoints

Hello everyone,

I’ve been working on this for a couple days now and can’t seem to come up with a solution. My end goal:

User inputs: Point number range (E.g. 360-370), select an alignment, select point groups (Note it needs to be capable of selecting the points within the number range AND if it exists within the designated point groups. It will also likely be 4 possible point groups)

End goal: Assign an alignment station value for each selected cogopoint and then drawn a 3Dpolyline from the cogopoint at the lowest station value, to the next, in sequence, until it finishes at the last cogopoint which corresponds to the highest station value.

Please find attached my dynamo file so far and screen shot. I’m really struggling with the point selection based on the filter criteria. It’s worth noting that I only have the one point group at the moment “bends” but there will be 4 point groups titled bends,grd,cut,bh that it needs to look inside of for the point range.

Any input would be greatly appreciated. I am relatively new to dynamo and learning as I go.

EDIT: I’ve checked that the data coming out of the range list and the sorted keys list is the same. One was Double and one was Int64. I converted the Double to be Int64 (double checked with watch nodes) and it still didn’t fix the problem. My list.contains bool output is False when it should be positive.

EDIT2: I understand now that I have to extract the geometry of the points to then be fed into the Alignment.StationOffsetByPoint node but I am at loss on how to only extract the geometry from a specific range of points. I’ve concluded that I do not need this to work with specific point groups, I literally just need to select a given range of points (360-380 for example), extract the geometry of that, and plug it into that point input but I cannot figure out how to do it haha
Cogo to 3dPoly.dyn (52.8 KB)

Amigo @PLM1987 buenas. I haven’t opened your file yet, but at first look the problem is that: the Polycurve.Bypoints node needs points to work and you are feeding it with a double, the data type is the problem, I think it would be solved as shown in the image, I hope this helps!

2 Likes

Try this.


Cogo to 3dPoly V2.dyn (85.9 KB)

2 Likes

Thanks, James.

A few comments on this one:

  1. Is it possible once all the points have been selected to filter them based on a user input point number range? This is one of the things I was having issues with as the cogos are called in object format, then I tried using a “getnumber” node to get their corresponding point number. I was then using a string to number split to get a list of point numbers I wanted to filter against. You can have a look at the screen shot I included for my attempted workflow on that sorting method. This is an important step because I am using these 3d polys as breaklines and I want to limit the data they’re drawn between

  2. When I try your script as it currently exists I get some errors. Connecting watch nodes and mapping it out after each step it seems some of the errors may be irrelevant as the data looks fine, but the output of the Filterbyboolmask is null - any thoughts?

Appreciate the reply!
Yes I did eventually notice this error and I made an edit to the original post. The issue I was having was I needed to filter based on a point number range, but the cogopoints nodes all return objects. So I was converting to point numbers, then filtering, but I had no way of getting them back into objects to feed into an object.geometry node… so I am stumped

  1. Apologies i miss interpreted your need.
    If you pass the count number through instead of station value and filter on the cogo point objects you get what i hope is the selection you require.


    Cogo to 3dPoly V3.dyn (105.1 KB)

  2. Just tested and if you try to include a point group that doesn’t exist it gets added as a null value which then cannot be masked against so throws the null error.

1 Like

Yes this is what I mean and I understand now that I can put the point number range I want to filter on into the “station lower / upper” inputs. The problem I have now is the 3dpolyline isn’t drawing properly.

The whole purpose of this script is to substitute a 3Dpoly>'pn>point number range command so my points aren’t numbered properly in the order I want to draw my 3dpolyline. For example if I have points 1-12, and they exist along my alignment in the image below, my 3dpolyline will be drawn like the blue line here. I want the 3dpoly to be drawn from point 1 to point 6 following my alignment

Run the Stations through a List.Sort Node here:

1 Like

Awesome!
99% working. I am just losing my Z value after the object.geometry node. So all the vertices that are created along the 3dpolyline have zero elevations. Is it possible to extract the Z values of the object.geometry and map it to the Z value of the coordinate system?

A Point.Z node should do the trick

1 Like

Works but it’s not the proper Z value corresponding to each vertex. For example, vertex 1 in the polyline is corresponding to point number 373, which has an elevation value of 550m, which is point.z 9 on the list.
Sorting wouldn’t work either as that would just assign lowest to highest elevation. I need to map the proper elevation to the vertex

Try this, i tested it with a custom dataset and seemed to work fine.

1 Like

This fixed it!

Thanks again, James. These two Dynamo programs are a massive time saver for us.

Hi James. This may be a silly question, but is it possible to have the vertex of the polyline be at the x/y of the respected cogoPoint? The 3DPoly is currently being sketched on the alignment station rather than the X,Y of the cogopoint.

In a perfect world it would sort the cogo points based on their nearest alignment station value, and then draw the 3dpoly between each cogo point’s X,Y value rather than the station value. This way it still makes a continuous poly that follows the alignment direction, but is actually drawn on the points

Hi.
I had to test this out by my self but instead of CoGopoints I tested to get coordinates from circles, will work for blocks, points or other object on a layer and with an insertion point.
The toughest issue that I came up to was to get the correct sort of the list of Stations and Offset values, my conclusion where when I couldn’t get the correct sort of offset, then I had to switch the inputs for the List.SortByKey node as you see in the first wcreenshot.
By the way “List.GetItemAtIndex” made it even easier with less nodes :slight_smile:

2 Likes

Morning @PLM1987,

Instead of the Z values, pass your Cogo Point Geometry through the Get Item At Index after the Sort Index by Value node as shown and feed it straight into the Points field of the Create 3D Poly Node.

This should convert your points to stations, order the points by station number and then generate a 3d poly between the Cogo Point locations.

1 Like

That did it. Thanks again!

Thank you for the reply, Patrick! This is a clever approach.

2 Likes

Thanks for those kind words :slight_smile:
It was you that gave the idea
Regards,
Patrick

2 Likes