Creating a graph to create cogo points from exploded cad objects

Hi all,

I’m still pretty new to Dynamo and I guess i may need a bit more help for visionning the path forward onto my code/graph.

I received oftenly exploded cad objects (From cogo points into ACAD Points and Text with no z value)

I am trying to recreate Cogo points with this information and what bugs me is that everything is exploded

Anyone would have an idea what approach i could have to rebuild these exploded objects ?

Hi, can you upload the dwg file ? or just one exploded point.

1 Like

you can just get the value of text by EATTEXT command

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.

2 Likes

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 ?

Here’s a sample of the DWG with the information
SampleExplodedCogo.dwg (82.8 KB)

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.

1 Like

Oh that could be something to try @A.C3D !

Ill try to find some time this week in between my supports to try and do some testings

1 Like

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.

Rebuild Cogo Points.dyn (269.9 KB)

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.

3 Likes

Great question to work out for my blog one day, so I crafted something together from scratch.

Exploded Cogo Points.dwg (1002.3 KB)
Restore Cogo Points.dyn (46.8 KB)

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:

image

But sometimes not:

image

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.

2 Likes

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’m just thinking - I don’t know if it’s possible

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 :slight_smile:

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

1 Like

@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

Oups ok i noticed it’s based on DbPoint nodes !

Thx @jacob.small !

Ill work on this to see if i can adapt something with my dataset :slight_smile:

Will keep you folks posted !

1 Like

If you add the DocumentExtensions.AddNewTypes node of the Civil3DToolkit, and run the graph once, you can select DBPoints:

image

2 Likes

Thanx for the suggestion

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 :slight_smile:
Ill keep you folks posted ! Thank you again for guiding me through this

It’s always “exciting” to learn more about Dynamo !

1 Like