# Creating a graph to create cogo points from exploded cad objects

**URL:** <https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002>\
**Category:** Civil 3D\
**Tags:** dynamo, civil3d\
**Created:** [July 23, 2024, 8:13pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002 "2024-07-23T20:13:09Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 23, 2024, 8:13pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/1 "2024-07-23T20:13:09Z")

</div>

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)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/4/b42b5722cd4abbcac3bb672afe8b065a1f48e13e.png)

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 ?

---

<div class="post-metadata">

**Author:** ![A.C3D](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/a.c3d/32/196902_2.png) [@A.C3D](https://forum.dynamobim.com/u/A.C3D)\
**Post date:** [July 24, 2024, 6:41am UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/2 "2024-07-24T06:41:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmark](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@jmark](https://forum.dynamobim.com/u/jmark)\
**Post date:** [July 24, 2024, 6:58am UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/3 "2024-07-24T06:58:04Z")

</div>

you can just get the value of text by `EATTEXT` command

---

<div class="post-metadata">

**Author:** ![s.proch](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@s.proch](https://forum.dynamobim.com/u/s.proch)\
**Post date:** [July 24, 2024, 8:35am UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/4 "2024-07-24T08:35:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [July 24, 2024, 9:08am UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/5 "2024-07-24T09:08:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 24, 2024, 12:46pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/6 "2024-07-24T12:46:38Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 24, 2024, 12:59pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/7 "2024-07-24T12:59:35Z")

</div>

Here’s a sample of the DWG with the information  
[SampleExplodedCogo.dwg](https://forum.dynamobim.com/uploads/short-url/uTP57Gr41Dt0QngTmOAEEVjzRQe.dwg) (82.8 KB)

---

<div class="post-metadata">

**Author:** ![A.C3D](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/a.c3d/32/196902_2.png) [@A.C3D](https://forum.dynamobim.com/u/A.C3D)\
**Post date:** [July 24, 2024, 2:21pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/8 "2024-07-24T14:21:04Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/9/29fea4f88d2a4ced99354b92a0490a81a130d5c2.png)

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 24, 2024, 3:27pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/9 "2024-07-24T15:27:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [July 24, 2024, 4:38pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/10 "2024-07-24T16:38:08Z")

</div>

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](https://forum.dynamobim.com/uploads/short-url/yggILT6SVSaZWNkJFM7fzyiubWL.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.

---

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [July 25, 2024, 7:03am UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/11 "2024-07-25T07:03:07Z")

</div>

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

[Exploded Cogo Points.dwg](https://forum.dynamobim.com/uploads/short-url/7s74hMhDWS3dEVNM2U0SVGE6zWP.dwg) (1002.3 KB)  
[Restore Cogo Points.dyn](https://forum.dynamobim.com/uploads/short-url/uhoyz48BANtfuTvS2QQ8Lspecq6.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](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/1/a186256cea4e040f69d7ba79954ad5746f30e9bf.png)

But sometimes not:

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/5/c54a8aa622ab50884da157e216495dbdd59ade4d.png)

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.

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 25, 2024, 2:17pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/12 "2024-07-25T14:17:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [July 25, 2024, 3:59pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/13 "2024-07-25T15:59:31Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 25, 2024, 4:30pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/14 "2024-07-25T16:30:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 26, 2024, 7:41pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/15 "2024-07-26T19:41:04Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 26, 2024, 7:48pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/16 "2024-07-26T19:48:20Z")

</div>

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 🙂

Will keep you folks posted !

---

<div class="post-metadata">

**Author:** ![Anton\_Huizinga](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/anton_huizinga/32/155377_2.png) [@Anton\_Huizinga](https://forum.dynamobim.com/u/Anton_Huizinga)\
**Post date:** [July 26, 2024, 7:59pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/17 "2024-07-26T19:59:35Z")

</div>

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

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/f/8f0d6d881882c4352364ebbfc098b86fbbb5fcab.png)

---

<div class="post-metadata">

**Author:** ![Cyberflow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/cyberflow/32/169539_2.png) [@Cyberflow](https://forum.dynamobim.com/u/Cyberflow)\
**Post date:** [July 27, 2024, 7:46pm UTC](https://forum.dynamobim.com/t/creating-a-graph-to-create-cogo-points-from-exploded-cad-objects/103002/18 "2024-07-27T19:46:56Z")

</div>

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

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