Results 1 to 8 of 8

Thread: Using VBA to create AutoCAD layouts

  1. #1
    100 Club dtownsend's Avatar
    Join Date
    2006-06
    Location
    Atlanta, GA
    Posts
    163
    Login to Give a bone
    0

    Default Using VBA to create AutoCAD layouts

    I would like to automate a process that I go threw when doing pile cap as-builts.

    For each pile cap I create a layout that has a view of the pile cap and is labeled with the grid line intersect that the cap is on..I also sometime will add a table with the asbuilt coordinates to the layout as well.

    This is a very long process when you have hundreds or caps to create sheets for!

    Any ideas of if I can do this with VBA? I am getting better with VB 2005 express and have made a few apps, but I havent messed with using it with autocad.

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    Suggestion...If you're trying to automate a process, you first need to obtain a detailed list of the current process. Then trim out any unnecessary steps (usually some "that's the way we've always done it" that no longer has any value). Then, before you can start coding, figure out how you might do that manually in acad. Then reproduce it programatically. We can only help you with the last part. I have no idea what a pile cap is.
    C:> ED WORKING....

  3. #3
    100 Club dtownsend's Avatar
    Join Date
    2006-06
    Location
    Atlanta, GA
    Posts
    163
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    when you say do it manually do you mean the commands that are needed to do this?

    Most of it is done with a plugin (CG-Survey for AutoCAD), but it does have it own commands that can be typed in like autocad commands.

    Thanks for you help

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    That's just a matter of how detailed you need to be for your purposes. If you need to communicate to us when asking for help, you may need to be more explicit so that we understand. But what I said earlier was a general statement. Think of programming as a recipe. Eventually, you need to write down every step in code, like a recipe. If you are really familiar with a process, you might be able to sit down and just start writing code. But if the process is unfamiliar to you, or you are open to the possibility of redesigning it, then its best to document the basics of what you want to accomplish. So when I say 'do it manually', I mean from the user's point of view, what does the user need to accomplish and how would he do it. Then, you figure out how to to that programatically, looking for ways to cut out unnessary steps or steps you can do without user intervention. In the case commands performed by other apps, it may be necessary (or you might be better off, what happens if they go out of business) to replicate what they do, rather than rely on them.
    C:> ED WORKING....

  5. #5
    100 Club dtownsend's Avatar
    Join Date
    2006-06
    Location
    Atlanta, GA
    Posts
    163
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    Quote Originally Posted by Ed Jobe
    That's just a matter of how detailed you need to be for your purposes. If you need to communicate to us when asking for help, you may need to be more explicit so that we understand. But what I said earlier was a general statement. Think of programming as a recipe. Eventually, you need to write down every step in code, like a recipe. If you are really familiar with a process, you might be able to sit down and just start writing code. But if the process is unfamiliar to you, or you are open to the possibility of redesigning it, then its best to document the basics of what you want to accomplish. So when I say 'do it manually', I mean from the user's point of view, what does the user need to accomplish and how would he do it. Then, you figure out how to to that programatically, looking for ways to cut out unnessary steps or steps you can do without user intervention. In the case commands performed by other apps, it may be necessary (or you might be better off, what happens if they go out of business) to replicate what they do, rather than rely on them.
    Thats for clearing that up. I have done programming for a few years but nothing big so I understand basic processes of programming and I typically always get a fresh notepad before I start anything so I can map out what I want the program to do. As far as for my first post...looks like I still have some work to do.

    Also I would love to replicate what they do since their software is about $2000 a copy and the company I work for has around 10 or so copies. I'm not sure my skills as a programmer are at that point yet, but who knows.

    On another note do you know anything about using VBA for Revit? Ideally I would like to switch this whole process over to revit one day. The problem I am running into is coordinate system for revit is so different from autocad, so I'm not sure it would work but I'm sure that question is for another thread .

    My bonus question is do you know of any good resources for VBA for Revit books, internet, blogs, etc.?

    Thanks again

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,397
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    Sorry I don't know anything about Revit's object model, or if it even has an api exposed to vba. All I know about Revit is what I've heard argued about on the ADT ng's.
    C:> ED WORKING....

  7. #7
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Using VBA to create AutoCAD layouts

    Quote Originally Posted by dtownsend
    <SNIP>

    My bonus question is do you know of any good resources for VBA for Revit books, internet, blogs, etc.?
    Hi

    I believe the only exposed API in Revit is via Dot Net.

    For starters, head over HERE and HERE.

    Have a good one, Mike

  8. #8
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Smile Re: Using VBA to create AutoCAD layouts

    Hi, dtownsend
    Your task is very interesting for me
    Let you send me sample drawing with 1-2 layouts you
    need, maybe I could be to solve this problem I hope
    my e-mail: fixo@yandex.ru

    ~'J'~

Similar Threads

  1. Autocad 2009 e layouts
    By n3to in forum AutoCAD General
    Replies: 4
    Last Post: 2008-05-05, 09:14 AM
  2. Autocad 2009 e layouts
    By n3to in forum AutoCAD General
    Replies: 0
    Last Post: 2008-04-15, 10:36 AM
  3. Replies: 13
    Last Post: 2007-01-11, 01:28 PM
  4. Exporting Layouts into AutoCAD
    By sanjay_yallure in forum AutoCAD 3D (2006 or below)
    Replies: 6
    Last Post: 2006-03-25, 08:50 PM
  5. DWF Composer - Create layouts based on blocks
    By Batman in forum Design Review - General
    Replies: 1
    Last Post: 2005-07-18, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •