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.
Solved! Go to Solution.
Solved by neilyj666. Go to Solution.
Solved by andrewpuller3811. Go to Solution.
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.
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.
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.
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....
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.
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.
Thanks Andrew - that works well.
Just tried with 18 boundaries and no problems
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.
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.
Give this a try.
Works, on my machine at home. Haven't done much testing though.
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.
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 fine
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.
@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.
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
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.
Can't find what you're looking for? Ask the community or share your knowledge.