View Full Version : ObjectArx : where to start from ?
david
11-18-2004, 09:41 AM
I am completely new to AutoCad and I was asked by my boss to explore
ObjectArx + C++ programming (he gave me a 15 days deadline) to see if
that was a viable way to draw some 2D graphics on the AutoCad window,
out of data stored in Excel format, possibly CSV. (Sorry if I didn't
use the proper terms, but I'm a AC newbie)
Of course I'm not new to C++, writing the math engine to process data
is not a problem. On the contrary I don't know how to draw graphics
primitive on a AutoCad window, so I began browsing some of the example
and help files shipped with AutoDesk MAp 3D (ObjectArxLabs.chm,
arxdev.chm and arxdoc.chm), coding the provided examples, but I soon
got lost.
I mean there's too much, too many details, while I just need to get an
overview of what ObjectArx is, and can do.
I don't need at all to master the AutoCad thing, I can't, I haven't
the time, and that's completely different from my programming
experience and attitude.
The final customer just asked to have these 2D graphics drawn on a
given window; what s/he will do then with that, it's not my own
business.
So can someone please help me and tell me where to look in the help
and examples files, to be on a fast(er) track, or where on the
InterNet can I find a FREE ObjectArx tutorial/primer which doesn't
require to master the whole AutoCad + ObjectArx thing, before being
able to understand how to do some basics ObjectArx programming ?
Thanks,
David
PS: I know that you can do some programming in AutoCad via VBA macros,
but that option has already been considered and rejected.
Rick Francken
11-19-2004, 05:52 AM
"david" <fake_david_fake-usenet@yahoo.it> wrote in message
news:e90bb180.0411180941.1450cc75@posting.google.com...I am completely new to AutoCad and I was asked by my boss to explore ObjectArx + C++ programming (he gave me a 15 days deadline) to see if that was a viable way to draw some 2D graphics on the AutoCad window, out of data stored in Excel format, possibly CSV. (Sorry if I didn't use the proper terms, but I'm a AC newbie)
15 days, eh? To get a handle on two knowledge domains? A bit of a tight
timeline, isn't it?
Of course I'm not new to C++, writing the math engine to process data is not a problem. On the contrary I don't know how to draw graphics primitive on a AutoCad window, so I began browsing some of the example and help files shipped with AutoDesk MAp 3D (ObjectArxLabs.chm, arxdev.chm and arxdoc.chm), coding the provided examples, but I soon got lost. I mean there's too much, too many details, while I just need to get an overview of what ObjectArx is, and can do.
Here are a couple of resources to check out:
Autodesk ObjectARX discussion forum:
news://discussion.autodesk.com/autodesk.autocad.objectarx
Autodesk Developer Center, ObjectARX SDK download:
http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=785550
I don't need at all to master the AutoCad thing, I can't, I haven't the time, and that's completely different from my programming experience and attitude.
If you don't have time to learn AutoCAD, and it's different from your
programming experience and attitude, then Object ARX programming
is NOT the route you need to take. You really need to know AutoCAD
before you go hacking into the guts of AutoCAD with ObjectARX.
Most ObjectARX developers worked with AutoCAD for years
before ever writing a single line of ObjectARX C++ code.
The final customer just asked to have these 2D graphics drawn on a given window; what s/he will do then with that, it's not my own business. So can someone please help me and tell me where to look in the help and examples files, to be on a fast(er) track, or where on the InterNet can I find a FREE ObjectArx tutorial/primer which doesn't require to master the whole AutoCad + ObjectArx thing, before being able to understand how to do some basics ObjectArx programming ? Thanks, David PS: I know that you can do some programming in AutoCad via VBA macros, but that option has already been considered and rejected.
Out of curiosity, why was it rejected? It seems to me that using the VBA
approach
to read XLS or CSV data to create 2D graphics would be about the fastest,
easiest approach to the problem. But regardless of whether you choose VBA
macros,
or AutoLisp routines, or ObjectARX modules, you have to know how AutoCAD
works.
Just my $0.02...
-Rick
Henrik Vallgren
11-26-2004, 07:21 AM
Hi David,
Some basic steps:
1. The drawing is represented by the AcDbDatabase class (there's a
acdbCurDwg macro to get the active database)
2. There's a lot of tables in there, you're interested in the
AcDbBlockTable
3. Find the modelspace record (use the ACDB_MODEL_SPACE macro)
4. Open it for write as an AcDbBlockTableRecord
5. Add any lines (AcDbLine), arcs (AcDbArc) or circles (AcDbCircle) to
the modelspace
6. close all opened objects
I'm getting close to releasing my own CAD software, due in January.
Using that would be easier for you:
1. Derive a command object from CommandStd
2. Create any Line, Arc or Circle and add it using the Add
memberfunction
Good luck,
Henrik Vallgren
www.stream-space.com
www.thecadproject.com
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.