Ad

Monday, December 15, 2008

How to Create Civil 3D Points for Each TIN Vertex - VBA

The From the Ground Up Blog had a post on how to create COGO points from a surface. The post may be found at this link: http://civilcommunity.autodesk.com/blogs/blog/6/blogpost/10511/

While the method works it could be easier using some programming. The first thing we need to do is make sure we get the Civil 3D document so we can add the points to the drawing.

image

Next lets have the user select the surface they want the points created from. The On Resume Next is error catching in case the user doesn't select an object or escapes out of the command.

image

So now that we have the object we need to make sure it is a surface. Once we make sure the object selected is a surface we need to create the points. To do this we will get the points out of the surface using the Points Method of the surface. The Points is a list (an array) of points in the X,Y,Z format. Next we'll create the Civil 3D points using the AddMultiple method of the Points Object. To use the AddMultiple method we need to give how many points we want created, the list of point locations (an array) in X,Y,Z format and what number to start with in the array. The code below shows the completed code.

image

The above code creates points without a description, so additional work would be needed to add the descriptions. The method should be easier than exploding the surface. The completed code may be found on this page: http://style.civil3dreminders.com/programming

Correction Post: http://blog.civil3dreminders.com/2008/12/how-to-create-civil-3d-points-for-each.html

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad