muck Posted January 18, 2012 Posted January 18, 2012 I have recently upgraded form AutoCAD 2010 to AutoCAD 2012 (64 bit). I am using the 64 bit AutoCAD enabler. I notice that my VBA routines on this new will not run properly. Text Field that I typed data into will not allow me to enter data. Is there a fast solution to this problem that does not envolve recoding? Thank you, Quote
BlackBox Posted January 18, 2012 Posted January 18, 2012 In the short-term, have you installed the appropriate VBA Enabler for your version? Thinking more long-term, consider porting your code to VB.NET - You'll need Visual Studio 2010 (I use Express), the appropriate ObjectARX SDK(s), and I recommend you also use the current Wizard for properly debugging (when using Express). Quote
Bill Tillman Posted January 18, 2012 Posted January 18, 2012 Yes, what RenderMan said. I just read an article this morning about this very subject. After 2009, AutoDesk is no longer including the VBA Enabler deferring instead to the .NET world. They are unsure how long they will support this so I gave my client the heads up today that we might want to rethink our approach in doing all this VBA stuff. If in 24 months it's all gone away and the newer versions of AutoCAD only work with .NET...we are trying to think that far ahead. Quote
BlackBox Posted January 18, 2012 Posted January 18, 2012 VBA will die through attrition - IMO. Microsoft is no longer supporting it (and hasn't for some time), and at some point Autodesk will stop providing the applicable enabler(s). But for now, it's available as a separate install. I believe the 2013 has a VBA enabler - oops - shhhh, still in Beta testing! .NET is becoming the recommended development framework of Autodesk's choice. Many find LISP to be dominant in actual usage, but inadequate to handle many of the newer entity properties and methods (i.e., using vlax-dump-object on newer AECC* Objects). Thankfully, .NET provides a handy little Method by the name of LispFunction - This is how I am starting to make certain .NET functionality available from within LISP. :wink: For example: My GetOwner function uses System.IO.File Class from LISP. Quote
muck Posted January 18, 2012 Author Posted January 18, 2012 Well, I installed 64 bit VBA enabler with 64 bit of AutoCAD 2012. Thank you, Quote
BlackBox Posted January 18, 2012 Posted January 18, 2012 muck said: Well, I installed 64 bit VBA enabler with 64 bit of AutoCAD 2012. Did that allow your VBA routine(s) to function properly? Quote
BIGAL Posted January 19, 2012 Posted January 19, 2012 Its interesting we have a few VBA programs and rather than go .net I am looking at the ones we really use and convert them back to VL or plain lisp. The question is where are the conversion tools ? the lisp to C++ was created years ago, wheres the autodesk lisp to .net ? I have 200+ to convert. Is Autodesk just intent on only having programers or developors write simple code in future. As a Autocad dealer in my past I spoke to lots of microstation people and said why aren't they using MDL and the answer was to hard, compared to simple lisp. As said before CorelCAD's macro record writes .net code ! Look at word and excell macros wrote VBA code what does current versions write I dont have a copy ? Anyway I will get off my soapbox now. Quote
muck Posted January 19, 2012 Author Posted January 19, 2012 When I run the program with 2012 VBA (64bit) my text fields will not allow me to enter anything into them. I try to change some text box properties but that did not work. Any suggestions? Thank you, Quote
BlackBox Posted January 19, 2012 Posted January 19, 2012 BIGAL said: Its interesting we have a few VBA programs and rather than go .net I am looking at the ones we really use and convert them back to VL or plain lisp. Visual LISP is my primary development language; vlax-get-or-create-object is my/your friend. LoL BIGAL said: The question is where are the conversion tools ? the lisp to C++ was created years ago, wheres the autodesk lisp to .net ? I have 200+ to convert. Is Autodesk just intent on only having programers or developors write simple code in future. LISP is much more elegant, and simpler to learn. The .NET API is constantly growing from version to version, and is considered a 'professional' development language, despite LISP's popularity with the masses. In a thread I read the other day, Lee points out that LISP is +/-5 lines of code as compared to the same function in C# at 20+ lines of code. That is why I am sticking to Visual LISP for the most part, and where there may be a short coming, I attempt to make .NET functionality available via LispFunction Method. Quote
madpanda Posted January 31, 2012 Posted January 31, 2012 It's a 64bit problem with VBA, Autodesk has no solution for VBA not running correctly in 64bit environment, in fact we tried a virtual 32bit os with Autocad in it, and it still had a problem. talk about killer for some of us that huge VBA scripts, and don't have the time to convert into dotnet! VBA will run in 64bit if the program is very simple, but make sure you have your code explicit. Also sometimes you may also overlook your references, make sure your still not referencing the 09 type library. Our current crutch is a couple of older 32bit machines to run our larger code. Quote
BlackBox Posted January 31, 2012 Posted January 31, 2012 I love the user name, makes me think of these - Quote
DANIEL Posted January 31, 2012 Posted January 31, 2012 RenderMan said: I love the user name, makes me think of these - lol, thats great ... Quote
BlackBox Posted January 31, 2012 Posted January 31, 2012 DANIEL said: lol, thats great ... What can I say, I have a dark sense of humor. Quote
JPL2012 Posted February 7, 2012 Posted February 7, 2012 (edited) This issue is creating a huge issue for an "old guy" like me...I bascially write VBA fast and easy - we actually use VBA on every project, every day... Check this video out - debugging within the VBAIDE for 2012? This jing Video shows the nature of debugging in the IDE vs running the VBA via Lisp... have fun figuring this one out - link to video - http://screencast.com/t/sfaQsj4Lo7XK --JPL my Lisp Code used to run the VBA is here: ;;;VBA Commands for Menus ;;;J.Lyons 2011 ;;;load and run any VBA application found in the search path (defun runmyvba (dvb macro) (setvar "cmdecho" 0) (setvar "filedia" 0) (if (findfile dvb) (progn (vl-vbaload (findfile dvb)) (vl-vbarun macro) ) ) (setvar "filedia" 1) (princ) ) (defun C:TESTBOX () (runmyvba "YourVBAFilename.dvb" "YourVBAPublicModuleCommand") (princ) ) Edited February 7, 2012 by JPL2012 Quote
SLW210 Posted February 7, 2012 Posted February 7, 2012 JPL2012, Please read the CODE POSTING GUIDELINES and edit your post. Quote
BlackBox Posted February 7, 2012 Posted February 7, 2012 JPL2012 said: my Lisp Code used to run the VBA is here: FWIW - Here's a simplified version: (defun c:[color=blue]FOO [/color]( / path) (vl-load-com) (if (setq path (findfile "[color=blue]FileName[/color].dvb")) (vl-vbarun (strcat path "[b][color=red]![/color][/b][color=blue]ModuleName[/color][size=3][b][color=red].[/color][/b][/size][color=blue]Command[/color]")) (prompt "\n** File not found ** ")) (princ)) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.