VB6 - AutoCAD communication

VB6 - AutoCAD communication

sgrya1
Advocate Advocate
974 Views
23 Replies
Message 1 of 24

VB6 - AutoCAD communication

sgrya1
Advocate
Advocate
Can someone point me in a direction here?

I want AutoCAD to communicate with a VB6 application i have made.

Basically I need a series of questions to be asked in AutoCAD and for my VB app to process the answers and draw things based on the answers given.

Is there a tutorial that someone could point me to or can someone post a simple example for me?

One extra thing is that I want to protect my application with a HASP key which may limit my options of how to implement this.

Hope someone can help.
0 Likes
975 Views
23 Replies
Replies (23)
Message 21 of 24

Anonymous
Not applicable
wrote in message news:5853767@discussion.autodesk.com...
Norman,

Thankyou very much for your reply. Your response heavily backs Mark's (MP)
suggestion that I search for GetXXX.

I clearly need some "self help" advise in how to search what I'm after.

I don't know what you mean by "Acad VBA help". Where is this located and how
do I access it?

like I said before....:-)
Help menu in acad
Help|Additional resources|Developer Help| vba etc...
look at the object model
under document see Utility
double click on that
hth
mark

You mentioned that it provides exactly the sample code I was after but I can't
find it.

Mark suggested google groups but
http://groups.google.com/group/autodesk.autocad.customization.vba/search?hl=en&group=autodesk.autocad.customization.vba&q=getxxx
offers 1 only result for "AcadUntility.GetPoint()"



http://groups.google.com/group/autodesk.autocad.customization.vba/search?hl=en&group=autodesk.autocad.customization.vba&q=.Utility
2300 results
http://groups.google.com/group/autodesk.autocad.customization.vba/search?hl=en&q=.Utility.GetString
72 results
etc etc
0 Likes
Message 22 of 24

Anonymous
Not applicable
Besides Mark has said, you can find the code example easily by open Acad VBA
IDE->Object Browser->AcadUtility, highlight GetPoint() method, click the
button with a "?" in it. This brings you right to the help article on
GetPoint() method and there is a link to see the sample code.

Again, I still think if you need user to interact with Acad, you'd better do
it inside Acad. However the code would be very similar if you do it by
automating Acad from external VB app, if not identical.

If you want to do it outside just because you want to hide your VBA code
being viewable, you can simply move most process logic code into ActiveX
DLL, and only use simple VBA code to call the DLL. So you have VBA
macro/command in Acad but the code for the main process logic is compiled in
ActiveX DLL. This is easy way to protect VBA code.


"sgrya1" wrote in message news:5853767@discussion.autodesk.com...
Norman,

Thankyou very much for your reply. Your response heavily backs Mark's (MP)
suggestion that I search for GetXXX.

I clearly need some “self help” advise in how to search what I’m after.

I don't know what you mean by “Acad VBA help”. Where is this located and how
do I access it?

You mentioned that it provides exactly the sample code I was after but I can’t
find it.

Mark suggested google groups but
http://groups.google.com/group/autodesk.autocad.customization.vba/search?hl=en&group=autodesk.autocad.customization.vba&q=getxxx
offers 1 only result for “AcadUntility.GetPoint()”

I don’t necessarily want to automate Acad from a stand-alone exe. I just
want to protect what I’ve created with a HASP key.
As you say it would be better if I have VB(A) work with the drawing that
that is open so that I don’t have problems in understanding which open
drawing the exe should be working with.

Can I protect the VBA code that works inside AutoCAD? To be honest I’ve
never created VB code inside AutoCAD so I don’t know where to start and is
the reason I’m asking the question.

To try to explain my application, all I want is for AutoCAD to converse with
the user asking for a start point and an end point and what to insert at the
start points and end points and what to do in between. It’s a series of
questions and mouse clicks for different adjustment locations. After a few
calculations I need to then insert different blocks here and there and add
numerical text values at defined points.
You mention that I could make my VB6 app as an ActiveX EXE, COM
automate-able. Sorry but not so sure what you mean by that either.
0 Likes
Message 23 of 24

sgrya1
Advocate
Advocate
Thankyou Mark and Norman!!!!

I haven't had a chance to look search in detail your responces but from what I've read you appear to have explained exactly what I need to look at and what I need to consider.

I'm running AutoCAD 2007 which may be a reason I'm not following what you are saying in terms of AutoCAD help files but I'm sure I'll find what you have described.

Thanks again very much for your invaluable knowlege. Just wish you were in the same office to help me through what I'm no doubt about to fumble through.

Kind Regards,

Sam
0 Likes
Message 24 of 24

Anonymous
Not applicable
Heh-heh, I step away from these NG's for a few days and missed all the fun!

Anyway, glad to see you got more of the info you needed. One additional advantage for moving your code into a VB-generated DLL is that it executes more quickly. An external exe is faced with cross-process calls that are quite a bit slower. This would probably not matter while you are just gathering user input, but once your app starts using that info to create drawing entities, you would probably see a noticable difference in performance.
0 Likes