Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Extract all surface boundaries

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
neilyj666
1333 Views, 16 Replies

Extract all surface boundaries

Found this code at //blog.civil3dreminders.com/2011/0 ... aries. html to extract all surface boundaries - something I do a lot. How can I take this code and use it in C3D 2012

Extract All Surface Boundaries

Ever want to extract a bunch of surface boundaries? I have, but I don't really want to select each and every surface. Here is some code for VBA that will automate the process.

Sub ExtractBoundaries()
Dim oAcadObject As AcadObject
For Each oAcadObject In ThisDrawing.ModelSpace
If (TypeOf oAcadObject Is AeccTinSurface) Then
Dim oSurf As AeccTinSurface
Set oSurf = oAcadObject

oSurf.ExtractBorder aeccDisplayOrientationPlan

End If
Next

End Sub


It's similar code for vb.NET.

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
16 REPLIES 16
Message 2 of 17
neilyj666
in reply to: neilyj666

No takers??

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 3 of 17
Jeff_M
in reply to: neilyj666

Do you have the VBA Module for 2012? If so you can create it yourself, if not, the .NET version would be the way to go. I'd suggest staying away fro VBA unless you need it for other macros you have. If no one chimes in with the "how" before morning (California Monday morning for me) I'll throw together a .NET version.

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 17
Jeff_M
in reply to: Jeff_M

Come to think of it, a quick lisp routine would probably suffice.

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 17
neilyj666
in reply to: Jeff_M

You make it sound so easy - unfortunately I'm VBA, .NET amd LISP illiterate - never seem to find the time to sit down and see what can be done so if you could put something together, it'd be much appreciated.....!!!!!

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 6 of 17
neilyj666
in reply to: neilyj666

I don't generally use VBA for anything (mainly use Lisp and .Net DLL's) but I downloaded the VBA enabler for 2012. However, I couldn't get the code to run - stopped on the 4th line........If (TypeOf oAcadObject Is AeccTinSurface) Then...but no idea why....Smiley Sad

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 7 of 17

Try this. I just put it together from christopher Fugitt's code and a bit of code I have been putting together for my own stuff.

 

I tested it on 2012 and it worked with 3 surfaces.

 

Unzip the ExtractBounds2012.dll file from ExtractBounds2012dll.zip.

 

In civil 3d load the dll by typing "netload" on the command line and then choose the extracted ExtractBounds2012.dll.

 

Then type "ExtallBdy" and the command will run.

 

This is pretty basic and will extract the surface boundaries.

 

I have also attached the vb.net project.



If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.

Andrew Puller
Maitland, NSW, Australia
Windows 10 Enterprise 64bit
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2021
Message 8 of 17

Thanks Andrew - that works well.

 

Just tried with 18 boundaries and no problemsSmiley HappySmiley Happy

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 9 of 17
jmayo-EE
in reply to: neilyj666

Let's throw in a big thank you for Christopher as well.

 

THANK YOU. 🙂

John Mayo

EESignature

Message 10 of 17
Civil3DReminders
in reply to: jmayo-EE

You are welcome. 

Message 11 of 17

Anyone able/willing to update this for 2013?? It's a very useful little routine.....

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 12 of 17

Give this a try.

 

Works, on my machine at home. Haven't done much testing though.

 



If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.

Andrew Puller
Maitland, NSW, Australia
Windows 10 Enterprise 64bit
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2021
Message 13 of 17

Quick question: what are you looking to do with the boundaries?

 

There are a few new items in 2013 that might change your workflows a little:

1. There is a new build option that will removed outer sliver triangles. This should help cleanup the surface without a lot of manual work

2. There is an option to use a surface as the hide boundary for another surface. What you can do with this is make a new surface and paste EG into it. Then use a corridor surface as a hide boundary in this new surface. It will make a hole the side of the corridor that will update with the corridor. This will allow your EG surface to have one set of contour colors and the corridor to have another.

 

Cheers,

 

Peter Funk

Autodesk, Inc.



Peter Funk
Autodesk, Inc.

Message 14 of 17

Thanks for this Andrew - it crashed the first time I tried until I remebered this thread http://forums.autodesk.com/t5/AutoCAD-2012/netload-error/td-p/3053446 after which it seems to run just fineSmiley Happy

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 15 of 17


@peterfunkautodesk wrote:

Quick question: what are you looking to do with the boundaries?

 

There are a few new items in 2013 that might change your workflows a little:

1. There is a new build option that will removed outer sliver triangles. This should help cleanup the surface without a lot of manual work

2. There is an option to use a surface as the hide boundary for another surface. What you can do with this is make a new surface and paste EG into it. Then use a corridor surface as a hide boundary in this new surface. It will make a hole the side of the corridor that will update with the corridor. This will allow your EG surface to have one set of contour colors and the corridor to have another.

 

Cheers,

 

Peter Funk

Autodesk, Inc.


I extract the boundaries, flatten to 2D and offset for calculating cut off ditch lengths, fencing lengths and areas.

 

Whilst I haven't explored the possibilities in 2013 yet the surface as hide boundary could be a time saver

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760
Message 16 of 17

It was mainly to use when Civil 3D failed at getting the task done.

 

The original project for this was a 17 mile levee reconstruction project. We had to show ramps from the adjoining area to the top of the levee. The angles on the ramps varied and almost certainly non-perpendicular to the centerline alignment. So each ramp had to be graded and then pasted into an overall finish grade surface. Ideally Civil 3D would have been able to paste those surfaces together, but unfortunately Civil 3D failed at properly honoring the boundaries. I suspect because the ramp surfaces where half on and half off the levee surface. I then needed to get an overall boundary that fixed Civil 3D's failure at doing the task. Rather then selecting 30+ surfaces and extracting the boundaries, creating this routine was faster. Especially when the design changed. I then could use the LineworkShrinkwrap command to create on large overall boundary fairly quickly.

 

Christohper

http://blog.civil3dreminders.com/

Message 17 of 17
neilyj666
in reply to: christopher

It would be good if the code could exclude those surfaces that were set to No Display......

neilyj (No connection with Autodesk other than using the products in the real world)
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


AEC Collection 2024 UKIE (mainly Civil 3D UKIE and IW)
Win 11 Pro x64, 1Tb Primary SSD, 1Tb Secondary SSD
64Gb RAM Intel(R) Xeon(R) W-11855M CPU @ 3.2GHz
NVIDIA RTX A5000 16Gb, Dual 27" Monitor, Dell Inspiron 7760

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report