I use this workflow when we receive topo survey in 2D. You could select the elevation text using some Qselect filters, move the text’s insertion point to the center of the marker (assuming the direction is always same), and use _MOVETEXTTOELEVATION command, then add the text at an elevation to a surface definition as drawing objects, and then finally extract points from that surface (you will need a surface style that shows points). This process doesn’t include dynamo but surely there will be a way to achieve this with Dynamo too.
Besides requesting for an unexploded Civil 3D file, you can check if the movement of the green text is the same in every situation. Then you can create a selection of the green text, transform them to the checked distance/direction, then you convert the text to a number and use it to create Cogo Points. If not directly, you could add AutoCAD Points with the X and Y of the green text and the numeric value as Z. Then it is easy to convert to Cogo Points.
Sometimes certain elevations text are moved to avoid overlap on the drawing … was wondering how i can find a way to associate that text to that Acad point to have the correct X,Y
Not sure if i can use an approach to fetch the object ID in order maybe ?
Are they sequential ?
If you move the text, it will be more difficult to identify which text is associated with the CAD point.
Try this:
In the Express Tools bar in Civil3D, you will find “Enclose in Object,” which creates a bounding box around your selected text. Transform those bounding boxes (polylines) to Dynamo geometry and points as well. Then use “Closest Points” to identify which bounding box is nearest to the CAD point. This way, you can take the closest bounding box and put the text inside as the elevation for your CAD point.
First up, I’d contact whoever sent you the DWG to ask for the non-butchered dataset.
I’m seeing points on multiple layers and blocks included instead of points, which makes it harder to manage. If you clean up the data first that will help.
That said the DYN below is likely a good start in terms of progression. It utilizes the the points as a key for a dictionary to allow quick association to other objects by location (the points have to match to 6 degrees of precision if memory serves). That ties most of the code and number text to a point fairly efficiently. Elevations are tougher as they’ve been moved inconsistently - nearest center of text is likely the best method there, doing a reverse search compared to how this was built.
After you get an elevation on each, building the cogo points should be rather simple using OOTB nodes and dictionary parsing. Give it a shot and see where you get.
The graph first finds the symbols and the elevation texts. Then it compares the location of the texts to the closest symbol. I used the insertion point, but the mid of the text bounding should work too. In all cases, a visual check is needed to see if there are issues. So the graph draws some lines and mostly it is correct:
But sometimes not:
In the end the graph creates Cogo Points with the location of the symbols and the elevation of the text value.
Only the incorrect Cogo Points need a manual edit.
Awesome stuff Anton !
I dont have time this week, doing some troubleshooting with a user
I don’t know if this is possible, but are the objectid or handle incremented numerically ?
Maybe could be a way to associate the points with the elevations ?
I wouldn’t rely on that. In my example the blocks were exploded with the BURST command, the symbols might have the original handles but the attributes were replaced by texts. Also a handle of a text might be followed by the handle of the next block’s handle.
In my example every text is compared to all blocks to find the shortest distance. Then you don’t need to assume things, but just visual check
Your right, it’s going to be a hard to do that in programming
Could do a delete objects on all the remaining objects that were used to create the cogo points and then we’ll only see the faulty points/elevations that werent converted into Cogo Points just to ease the workload atleast
@Anton_Huizinga :
I’d like to select autocad points instead of blocks and i noticed that the library doesn’t have an object types “point” in its list to use All object by type
I did manage create cogopoints now without a problem
Extracting the x,y from the DBpoint and using the string text doing a replace for “,” to “.” and get the Z information.
But i did that with a clean purged dataset with 10 points and texts.
A real life dataset has sometimes different points and text so ill try to integrate the nearest point to my graph to rafine stuff during next week
Ill keep you folks posted ! Thank you again for guiding me through this
It’s always “exciting” to learn more about Dynamo !