Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > using excel to draw in AUTOCAD


Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2002, 03:44 PM
webking
Guest
 
Posts: n/a
Default using excel to draw in AUTOCAD


Is it possible that by using some kind of routine in excel spread sheet we can make diagram of the object if we place x, y,z coordinate in AUTOCAD.
Like if i place X , Y , Z axes coordinates of an object in excel spread sheet can excel draw that object or lets say that the values from excel are picked up by AUTOCAD to make that object.
Reply With Quote
  #2  
Old 01-24-2002, 04:36 PM
MarkG
Guest
 
Posts: n/a
Post

Excel cannot access the AutoCAD object model but AutoCAD can read an Excel spreadsheet or an Access database. You would need to write code in AutoCAD VBA to read from a spreadsheet or connect to a database and then draw an object. It's also possible to do through VB by referencing the AutoCAD Object Library....... I read and write to databases on a regular basis from AutoCAD. AutoCAD uses DAO for database connectivity, at least through version 2000. ADO is not available in 2000 but may be in version 2002, I don't know.

Here's a simple snippet of code to connect to a database in AutoCAD VBA:

Code:
    'Connect to database
    '------------------------------------------------------------------------------------
    Set db = DBEngine.Workspaces(0).OpenDatabase("C:\Program Files\ACAD2000\cofdata.mdb")
    Set Rec = db.OpenRecordset("SELECT * FROM PFD_COF_Data WHERE " _
        & "UniqueEquipmentID = '" & cmbEquip.Text & "'")
Reply With Quote
  #3  
Old 01-26-2002, 11:38 AM
uncleshark
Guest
 
Posts: n/a
Default VBA to control autocad

It is possible to send data from excel to autocad using the sendkeys instruction. Just set up a loop that sends the data using the sendkeys instruction.

I used this method in word to create a 3d helix in autocad.
Reply With Quote
  #4  
Old 01-26-2002, 02:33 PM
webking
Guest
 
Posts: n/a
Default

Thank you for your help ful reply but can please guide me how to do this using MS word or excel.
Like if i wanna draw a Circle in AUTOCAD from Ms Word or excel what steps should i follow.
Is it possible that some how i can draw the Steel Angle Shapes in this way. Like my objective is to draw the shop drawings of a 60 meter high communication tower. Is it possible that i can do the same using Ms Excel. or is there any freeware which includes the Steel Shapes file for Autocad.
Reply With Quote
  #5  
Old 01-27-2002, 07:36 AM
uncleshark
Guest
 
Posts: n/a
Default Steel Shapes?

What are these steel shapes. I guess they are the profile shape of a steel beam . Is that right?

Ok.

Questions.
1. what version of autocad you using?
2. Do you need 3d drawing or just 2d
3. How much experience do you have with vba
4. what sort of data do you have in the spreadsheet. do you have an example

Please feel free to email me. I am only a newcomer but like i said, i have already got word to construct a helix in autocad and know the basics of controlling autocad from vba.
Reply With Quote
  #6  
Old 01-27-2002, 11:43 AM
webking
Guest
 
Posts: n/a
Default

The Steel Shapes are :-

Single ANgle and double Angle and Bolts.
basically i have to make the shop drawings for a communication tower. i have uploaded its design diagram on the web:-

http://tosirzaffar.4t.com

i have autocad 2002

new user of VBA.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->