VBA for Civil 3D


I’ve recently come across several people, for various reasons, need either a beginner’s class on VBA or need a refresher course on the topic.  Being a reseller and training facility, we are planning to offer such services.  But through various conversations I’ve had with many in the community, I’ve got a couple of good reference / self-training books for you to peruse.  They would be:

  1. AutoCAD 2004 VBA: A Programmer’s Reference (Paperback) by Joe Sutphin
  2. AutoCAD VBA Programming Tools and Techniques : Exploiting the Power of VBA in AutoCAD 2000 (Paperback) by Bill Kramer, et al.

Now, these books are available at Amazon.com for a reasonable price.  Yes, they are not new editions, but for the most part, VBA coding hasn’t drastically changed.  But you say, “what about civil 3d?”  Well, VBA programming is VBA programming, just change the variables for the application.  And there is documentation that comes with the software to explain the API, etc.  (I need to thank James Wedding & Peter Funk for pointing me to these resources)

Should you need help because you just don’t have the time to read the newspaper let alone a software manual, then just drop me note and I’ll get you the help you need!

Advertisements

About Kevin
Hi… I am a husband, father, brother and neighbor. I am employed as a Civil Engineer and have enjoyed playing the drums for the last 30+ years.

5 Responses to VBA for Civil 3D

  1. Good books never get old. Joe had another book, “Visual Basic How-To For AutoCAD” from OmniSource Publications. It’s more of a self-published tome, and is simply a spiral bound collection, but it’s the third resource I grab.

    Keep up the good posts!

    Like

  2. Mitch says:

    Kevin,

    You said there is documentation that comes with the software and even pointed out the people that showed it to you, but you haven’t exactly shown how we can get it.

    Also, could you give a little more detail as to what VBA can be used for and how easy/hard it is to learn in the context of scripting for C3D?

    Thanks,
    Mitch

    Like

  3. Kevin says:

    Mitch, the documentation that comes with Civil 3D for VBA is listed under the Help menu. Specifically:

    Help>Additional Resources>AutoCAD Developer Help.

    This brings up help documentation for completely customizing autocad, including VBA. There are 2 specific help files, one is a VBA guide (explains how to use VBA to develop applications to customize AutoCAD) and the other is a reference file (provides a reference to object model and related components).

    Also under Additional Resources is Autodesk Civil 3D Developer Help. This extends the previous 2 documents into the Civil 3D world by providing the Civil 3D object model and its parts.

    What can VBA be used for? Anything, which could be a simple application that would reduce a repetitive task you currently do, like setting the dview/twist and snapang settings, to a button click and 2 picks for a baseline. VBA is also the foundation for creating subassumblies in Civil 3D. Yes, there are many included in the product AND you can even create them using simple polylines, but to harness the power of Civil 3D, the best option is to write the VBA code to model the subassembly.

    Hopefully, this gets you started in the direction you need!

    Kevin

    Like

  4. Mitch says:

    Thanks for the quick reply Kevin. That answers my questions.

    Also, what is the difference between modeling a subassembly with a polyline and using a VBA script? I’d dive into it myself and find out but I’ve already done it the pline way and it seems to do everything I need. Is there a reason I should be scripting rather than drawing?

    – Mitch

    Like

  5. Kevin says:

    You’re welcome!

    The esential difference between subassemblies from polylines vs VBA scripting is that you can include simple or complex behavior used during corridor modeling. The VBA scripting also indicates how th model is used during post-modeling design operations – earthwork, interaction with grading objects, rendering, staged construction modeling, etc.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: