I was surprised to find when you create a Civil 3D point the manual way it doesn't keep the elevation of the place you select. I guess I've never noticed. Well here's a way to get the program to keep the elevation.
First thing that needs to get done is to get the base Civil 3D objects. I just copied the code from the sample programs that come with Civil 3D.
So now that we have the base Civil 3D objects we can create the rest of the program. First thing that needs to be done is to create a variable that is the Points Object of the drawing. Once we have that we can create a point and add it to the collection, but first we need to prompt the user to select a point. To do this I'll use the GetPoint utility.
So that's the basic code to get it to work. As with all my free stuff it needs some error catching, maybe a On Error Resume Next (not the best method), or adding a description to the point or a point number. Maybe in another post. To save you some time, I've posted the code here.
3 comments:
Christopher, your program looks like just what I have been looking for. As you, I was suprised that you can't set a point on an object and have it use the elevation. However, I downloaded your code, "AP" loaded it but can't get it to run. I have tried "getbasecivilobjects" and "createpointswithelevation" and I just get "command unknown". What am I doing wrong? I am using C3D 2009, SP1.
Here's a post on how to add a vba macro to a toolbar.
http://blog.civil3dreminders.com/2007/06/adding-vba-macro-to-toolbar.html
You can also run it by typing vbaload and selecting the file and then typeing vbarun at the command line and select createpointswithelevation from the list. You can also create a command alias to run it, I'm just not quite sure how to do that.
Christopher, work exactly as advertised. Thanks for the help.
Dave Couch
Post a Comment