Help needed to automate data association by proximity in Civil 3D/Dynamo

Good morning,

I’m facing a challenge and would appreciate some guidance.

Problem: I have received 20 drawing sheets containing cross-sections that I need to use for a quantity takeoff. However, these cross-sections are “exploded,” meaning they are just lines and text, not intelligent Civil 3D objects. This prevents me from extracting the data directly using standard Civil 3D tools. Each sheet contains approximately 300 individual cross-sections.

Current Solution: I’ve created a Dynamo script that allows me to select a group of objects (MText). The script then filters this selection by layer. The MText object on the “F-SC-MALHA-TXT” layer (which represents the station number) has a Property Set applied to it. The script then collects data from the other nearby MText objects (like area, volume, etc.) and transfers this information into the fields of that Property Set. The main issue with this approach is that I have to manually select the objects for each cross-section, one by one.

Idea for Improvement: Instead of selecting the objects for each section individually, I would like to improve the script to work on a larger selection of objects at once. The idea is to have the script automatically associate the data based on proximity.

For every MText that represents a station number, the script would search within a defined radius (e.g., 40 units) for all other relevant MText objects and automatically populate the Property Set for that station.

I am having a lot of difficulty figuring out how to handle and manage the data to make this proximity-based association work correctly.

I have attached the DWG and DYN files for reference.
seções explodidas.dwg (506.7 KB)
TRABALHO COM SEÇÕES R1.dyn (203.8 KB)



1 Like

I’m personally not well versed in the custom creation of python nodes or anything of that nature but if I was you, I would try working with the “SendCommand” node from the Camber? package and then do some list manipulation to utilize the “Select wp” command to repeatedly create a windowed object selection from points. Sequencing everything correctly might be a chore but it’s something I would try.

1 Like

Hi Igor! Sorry for being a bit late on that! I saw your post last week but only had time to check the file today.

I’ve created a simple dynamo script that filters your MTexts based on a choosen maximum distance. It seemed to work well enough on your file. You can enhance it on many ways, but I think this might be a start point for what you are seeking!

Also, are you brazilian too? I noticed some of the texts were in portuguese hahah

FILTER_SECTION_DATA.dyn (42.9 KB)

1 Like

Hi, thanks a lot for the solution and for your time! Yes, I am Brazilian! It’s always nice to meet a compatriot in these forums.

I actually managed to finish all the sheets right before you posted, but your solution looks much more elegant. I will definitely test it to learn from it and keep it for the next project. I really appreciate your help!

1 Like


Hey apegaia, thanks again for the script! I’m testing it now, but I’ve run into an issue.

It seems the Object.Location node isn’t working on my end. It’s showing a warning that it ‘cannot be resolved’, and the node is orange, as you can see in the screenshot.

Do you have any idea what might be causing this? Maybe I’m missing a specific package?

Thanks for the help!

Hi! As far as I know it’s meant to be a standard AutoCAD node on Civil 3d 2025 onwards.

image

I don’t know in which version of Dynamo it was implemented, but I’m currently running version 3.3.

There might be other ways to get its insertion point on older versions, but I’m not sure which nodes can be used to do so…


:frowning:

I think you can get the insertion point by parameter, as it was done below: