VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transferri​ng Custom Macro from AutoCAD 2004 to AutoCAD 2012

9 REPLIES 9
Reply
Message 1 of 10
mrrj44
631 Views, 9 Replies

Transferri​ng Custom Macro from AutoCAD 2004 to AutoCAD 2012

We are now running AutoCAD 2012 on our network.  We had a third party come in a long time ago and write us a custom macro that generates specsheets for our product.  The problem is it was written for AutoCAD 2004.

 

I'm hoping that someone out there can tell me there is a way to move that code from 2004 to 2012 somewhat easily.  If not easily, at least tell me that it is possible without having to rewrite the entire macro.

 

Any help would be awesome.

 

Mike

9 REPLIES 9
Message 2 of 10
Alfred.NESWADBA
in reply to: mrrj44

Hi,

 

>> and write us a custom macro

What type of "macro" is that, what file extension does the file have that you load "as macro"?

Without seeing what is in that macro, what functions of AutoCAD this macro is using it's hard to definitly say "yes it works" or "no it does not work".

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 10
mrrj44
in reply to: Alfred.NESWADBA

Ok,

 

I've dug into this a little more and it appears it is a little more involved than just being a macro.  The macro is actually pointing it toward an actual written vba program it appears.  The program actually outputs an autoCAD drawing that is the specsheet.  This probably makes this about impossible to transfer over now right? 

 

I mean I have the program files, but that's going to be pretty difficult or impossible to move without having that program re-written right?

 

 

Message 4 of 10
Alfred.NESWADBA
in reply to: mrrj44

Hi,

 

>> I mean I have the program files, but that's going to be pretty difficult or impossible to move

>> without having that program re-written right?

Again, without seeing the VBA-code it's impossible to say anything seriously. The chance is there, just chance the references to the current AutoCAD version and that might work. At least if you try that with a copy of a drawing on a system that is not connected to your network (so that tool can't touch any global data sources) there can't be anything more then either you get error-/exception-messages or maybe AutoCAD crashes.


- alfred -

PS: don't you have the chance to get on contact with the one that wrote that tool?

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 10
mrrj44
in reply to: Alfred.NESWADBA

Ok,

 

I've got two files here that I'm pretty sure are the source code.  They are .dvb files.  The file type says AutoCAD VBA Source and AutoCAD Menu Source.  Would these be my code?

 

There is also a .dll and a couple .exe's.

 

I attached a screenshot of what I'm looking at.

 

Let me know if I'm on the right track.

 

Oh, and no.  The party that wrote the code is M.I.A. Of course, this was almost 10 years ago it was written for them.

 

 

Message 6 of 10
Alfred.NESWADBA
in reply to: mrrj44

Hi,

 

>> I've got two files here that I'm pretty sure are the source code.  They are .dvb files. 

>> The file type says AutoCAD VBA Source and AutoCAD Menu Source.  Would these be my code?

>> There is also a .dll and a couple .exe's.

This may be a just a loader of the application and just as a guess from your screenshot the DLL is the main part of the application and this is not a source code (you can't edit it like a source code) and as your app is written for 2004 I guess the DLL will not run with 2012 or similar versions.

 

And EXE-files? The 3 applicationfiles in your screenshot are additional (un)installation files that might be needed to get the tool running, but are at least needed only once, not during runtime of your tool.

As MDAC_TYP exists in your screenshot you should be really careful with tests when your network is connected as this installs some objects needed to access databases, so any tests you run may modify databases.

 

But sorry, that is nothing else then guessing, only gut instinct.

I guess you should take a reseller (with knowledge of application development) near you and show him what you have, what is the current workflow and he should decide if there is a chance or not.

If there is no source code for the content of the DLL you may need to rewrite the whole thing (or let it write).

 

Sorry, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 10
dgorsman
in reply to: Alfred.NESWADBA

If you get it re-written, make sure you specify the source code as a deliverable product in addition to the finished application (its one of the upsides to purpose-built software).  That way if you run into similar problems in the future you stand a better chance of migrating things forward instead of a ground-up rewrite.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 8 of 10
mrrj44
in reply to: dgorsman

Ok,

 

I've thought of a different approach to this.  I don't know why we haven't thought of it to this point.  It woudl be kind of a band-aid until we get our new spec-sheet program written for 2012, but I have installed AutoCAD 2004 on the client computers who need the older spec application.

 

So, now all I need to know is.  Can you guys help me transfer that from one computer to another to be ran in 2004?

 

Thank You guys for all your help.

Message 9 of 10
Alfred.NESWADBA
in reply to: mrrj44

Hi,

 

>> Can you guys help me transfer that from one computer to another to be ran in 2004?

Difficult when not knowing what should be all included like menus, vba, lsp, dll, exe, maybe arx, linetypes, hatch patterns, ...

My first ask to that is: is there a setup you find to install that, do you have any setup files or a setup media?

 

If you don't have that the way to work seems to end in "try-and-error" (what is bad if you have a centralized database behind). Look to the support paths that are defined in AutoCAD, look to the menues that are loaded, ... and the directory of files that are included in that should be copied to the new system and the settings also applied to the new installation of AutoCAD.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 10 of 10
dgorsman
in reply to: Alfred.NESWADBA

All important points, and all related to proper documentation of the program.  Something else to specify for the rebuild.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost