Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AutoCad & VBA (MS Access 2K/SP1)

    I have an upcoming project calling for manipulating text in AutoCad drawings via an Access database. Can anyone point me to a good place of reference? I've been to AutoDesk's page & other places but can't find anything specific.
    Thanks,
    John

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AutoCad & VBA (MS Access 2K/SP1)

    <hr>manipulating text in AutoCad drawings via an Access database<hr>
    Just exactly what does that mean? Are you storing the drawings or links to them in Access? Are you using Access as an interface to do something to text in AutoCad drawings? What do you mean by manipulating text--putting it in, taking it out, changing it, modifying the font/format/etc? And why on earth would you use Access for doing *anything* with AutoCad drawings?
    Charlotte

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoCad & VBA (MS Access 2K/SP1)

    Charlotte,
    I work for an engineering firm and what we've been doing is add/edit/replace text in *named* attributes of the *.dwg files from data stored in an Access database. The "why.." is because the text on the dwgs has to remain current with the data in the database because we do lots of other things with it and, yes, that also means formatting the text as well as adding/ removing lines,blocks,etc.... The code in the database generates ACAD drawings or modifies existing ones via a lisp routine (basically a text file run as a script) run from the SHELL command within the Access app. I'm sure you know that ACAD drawings are more than just pictures (some are *only* text & lines), this saves thousands of hours versus a designer opening each file in AutoCad just to make pretty much brainless modifications. We have many hundreds of dwgs to maintain. This does work with ACAD 2K, but since it's now VBA compliant, I'd rather try that.
    Thanks,
    John

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AutoCad & VBA (MS Access 2K/SP1)

    That makes it much clearer, although I can't be of any real help to you myself. You'll have to set a reference to the AutoCAD object library in the Access VB Editor. That should give you the ability to directly manipulate the AutoCAD object model, assuming AutoCAD functions as an automation server. In the latest versions, it seems that most VBA-supporting clients do act as automation servers, so it will probably work. You would declare an object variable of the appropriate type (probably something like AutoCAD.Drawing, but I'm guessing here since I don't have it installed) and then you should be able to set that object variable to the drawing in question and interact with it.

    You might get some insight into the automation process from the Microsoft download that contains samples and white papers on automating Office apps for both Office 97 and 2000. Look for it at <A target="_blank" HREF=http://download.microsoft.com/download/office2000dev/sample/2/WIN98/EN-US/OFFAUTMN.EXE>http://download.microsoft.com/download/off...US/OFFAUTMN.EXE</A> It will at least give you an idea of the VBA approach as opposed to the method you've been using.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Mar 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AutoCad & VBA (MS Access 2K/SP1)

    There are two libraries to set (groan) references to and I did that, and already set references to AutoCad.AcadObject, etc.... thank goodness for auto-complete! I'll experiment with it. I guess I'm just looking for the "gotchas" and shortcuts that are bound to come up, but I suppose I'll find 'em!
    Thanks for your help.
    John

Posting Permissions

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