No more VBA in 2010? What do us utility programming drafters do?

No more VBA in 2010? What do us utility programming drafters do?

Anonymous
Not applicable
1,744 Views
37 Replies
Message 1 of 38

No more VBA in 2010? What do us utility programming drafters do?

Anonymous
Not applicable
It appears that as of 2010 AutoCAD will no longer have VBA. I can download it separately, but it doesn't sound like AutoCAD will be returning to VBA, so I am only delaying the inevitability of VBA programs that no longer work. I took a look at VB.net converting and it is different enough to give me an immediate headache. It seems to be an external programming language designed more for full time programmers than VBA was. I'm a drafter who also knows how to program in AutoLISP and VBA and write the occasional utility program, but not all that often. I am not sure how to proceed here.
As long as I'm on the subject, what happend to Visual Basic? Did it become VB.net? Will drafters with a little programming knowhow be limited to trying to squeeze out as much as they can from AutoLISP?
There have to be other drafters like myself running into the same problem, so any advice that people more familiar with these changes would be very helpful. I'm not sure that taking a bunch of classes on VB.net so that I can write one routine a year that is only appreciated by drafters would fly.
0 Likes
1,745 Views
37 Replies
Replies (37)
Message 21 of 38

awerning
Advocate
Advocate
I agree with most of your points. That's not to say that there are still more coding options in VLISP than in VBA. I code in both (and in .NET), and though .NET seems to be the obvious choice of the future, at the moment (our company still uses acad2008) I still seem to find that my only viable option for some of the tasks I need to get done is the combined ActiveX\LISP\VLISP (and also DOSLib at times) environment. But, then I recognize also that this is just my opinion...just as I also can't understand for the life of me why people like to eat uncooked tomatoes. Guess we all just come at it from different angles (and different taste buds).
0 Likes
Message 22 of 38

Anonymous
Not applicable
Here's why I use VBA with ACAD
I learnt VB from version 3
I programme MS Word, in VBA
I programme MS Excel, in VBA
I programme Inventor, in VBA
The commonality I find makes life easier for a poorly educated programmer for whom programming is a means to an end, NOT and end in itself. I tried Ruby to programme SketchUp, but gave up

But it's all a matter of personal choice.
0 Likes
Message 23 of 38

arcticad
Advisor
Advisor
Why I am no longer writing code in Lisp or VBA ...

The issue has become access to features and 64 bit compatibility.

As new features are added to the platform they are only accessible through VBA or .NET.

Examples are the Circuit Manager and the Ribbon.

It's unlikely that these will be exposed to Lisp. And as VBA is now in maintainance mode and will not be updated for 64 bit. I have moved on to .NET

And as mentioned, portability is a huge reason. I can take my code written in VBA or .NET and port it over to Revit, Solidworks or Office.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 24 of 38

muckmailer
Collaborator
Collaborator
Sorry for the misplaced threads above. My mistake & this is an important topic.
I don't know why AutoDesk took out VBA form 2010. Looks to me like they are
going backwards instead of forward. They should put both VBA and VBA.net
into the 2010 version if the want people to learn the new VB.net in their software.

Sorry for the threads
0 Likes
Message 25 of 38

muckmailer
Collaborator
Collaborator
sharpDevelop was mentioned in a previous thread. How can that help a drafter that
wants to have AutoCAD.net access with privacy as mentioned in that thread?
Thank you
0 Likes
Message 26 of 38

Anonymous
Not applicable
Privacy was not mentioned. What I stated was that my boss will not, or has not, installed the free Visual Studio Express on my machine, despite repeated mentions that all his code is going bye-bye.

I needed admin priveleges to install Visual Studio Express. I do not have admin priveleges. sharpDevelop installed without the admin priveleges
0 Likes
Message 27 of 38

muckmailer
Collaborator
Collaborator
Can you install the 2010 Vba downloadable add-on that AutoDesk has for Cad 2010?

Thank you
0 Likes
Message 28 of 38

Anonymous
Not applicable
Im still using '09, (although we have '10), but the point is still moot. if he wants to wait until '11 comes out, and suddenly 'allow' me to download VSE, and start coding major apps in .net, the next day, he's in for a terrible surprise.

My first basic program was written on a cave wall in Lescaux , France. If he wants that kind of experience in .net, he's gotta allow me -some- lead time.
0 Likes
Message 29 of 38

Anonymous
Not applicable
Yes you can load it on all 2010 AutoCAD based products except for Civil 3D, as Civil 3D installs with the VBA Add-in by default.
0 Likes
Message 30 of 38

Anonymous
Not applicable
When moving from VBA to VB.NET there are a few things to do and you can just about Copy and Paste the code from VBA to VB .NET.

In VB.NET add reference to the following:
ACDBMGD (DLL found in C:\Program Files\Autodesk\AutoCAD 2010\ Folder)
ACMGB (DLL found in C:\Program Files\Autodesk\AutoCAD 2010\ Folder)
AutoCAD 2010 Type Library
AutoCAD/ObjectDBX Common 18.0 Type Library

After you have done that in the "name.VB" code you will have to add the following Imports:
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.Interop
Sometime more than this depending on what you are coding.
Some other to add
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.GraphicsInterface
Imports Autodesk.AutoCAD.GraphicsSystem
Imports Autodesk.AutoCAD.LayerManager
Imports Autodesk.AutoCAD.PlottingServices
Imports Autodesk.AutoCAD.Publishing
Imports Autodesk.AutoCAD.Colors
Imports Autodesk.AutoCAD.ComponentModel
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput

If you are using ThisDrawing... in VBA you can do the following in VB.NET to make this still work
Dim ThisDrawing As AcadDocument
ThisDrawing = DocumentManager.MdiActiveDocument.AcadDocument
as it WILL NOT work by default as VB.NET does not know what that is because AutoCAD and an active drawing is not running
like it would be with VBA.

Then if you want to do a Regen to the drawing in VB .NET you would do type in this code:
ThisDrawing.Regen(Common.AcRegenType.acActiveViewport)
0 Likes
Message 31 of 38

Anonymous
Not applicable
Though it may work that easily for some, it won't for many and it's
probably best not to encourage people to EXPECT such a trouble free
migration.

--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO



dkwaite wrote:
> When moving from VBA to VB.NET there are a few things to do and you can just about Copy and Paste the code from VBA to VB .NET.
>
> In VB.NET add reference to the following:
> ACDBMGD (DLL found in C:\Program Files\Autodesk\AutoCAD 2010\ Folder)
> ACMGB (DLL found in C:\Program Files\Autodesk\AutoCAD 2010\ Folder)
> AutoCAD 2010 Type Library
> AutoCAD/ObjectDBX Common 18.0 Type Library
>
> After you have done that in the "name.VB" code you will have to add the following Imports:
> Imports Autodesk.AutoCAD.Runtime
> Imports Autodesk.AutoCAD.ApplicationServices
> Imports Autodesk.AutoCAD.ApplicationServices.Application
> Imports Autodesk.AutoCAD.Interop
> Sometime more than this depending on what you are coding.
> Some other to add
> Imports Autodesk.AutoCAD.Geometry
> Imports Autodesk.AutoCAD.GraphicsInterface
> Imports Autodesk.AutoCAD.GraphicsSystem
> Imports Autodesk.AutoCAD.LayerManager
> Imports Autodesk.AutoCAD.PlottingServices
> Imports Autodesk.AutoCAD.Publishing
> Imports Autodesk.AutoCAD.Colors
> Imports Autodesk.AutoCAD.ComponentModel
> Imports Autodesk.AutoCAD.DatabaseServices
> Imports Autodesk.AutoCAD.EditorInput
>
> If you are using ThisDrawing... in VBA you can do the following in VB.NET to make this still work
> Dim ThisDrawing As AcadDocument
> ThisDrawing = DocumentManager.MdiActiveDocument.AcadDocument
> as it WILL NOT work by default as VB.NET does not know what that is because AutoCAD and an active drawing is not running
> like it would be with VBA.
>
> Then if you want to do a Regen to the drawing in VB .NET you would do type in this code:
> ThisDrawing.Regen(Common.AcRegenType.acActiveViewport)
>
0 Likes
Message 32 of 38

Anonymous
Not applicable
... Oh, my achin' head... no more VBA... Well, apparently there goes a WHOLE BUNCH of work... We just "up"graded to 2010 on 6 machines. We've passed the initial installation stage, and are into the "regretting having upgraded" stage (how is it that AutoDesk stays in business??? I guess I've forgotten again... Oh, yes, Solid"Works" keeps them in business by being so much worse...). Now I find they've added ANOTHER stage called the "REALLY REGRETTING HAVING UPGRADED" stage with this no-VBA thing. Anyways, when I try to launch a Macro, I get a message that says I can download VBA, but I've got a choice of 32x or 64x. As VBA was ONLY a 32x application, I'm assuming that refers to the operating system which in our case is XP 64. Anyone out there know for sure?? Yes, I'd like to learn .Net, but I'm trying to manage a department, and learn a foriegn language for a client... I started VBA at VB5, just to massage AutoCAD, and I write most apps by copying code from another and modifying it. I'll try downloading the VBA patch and... hope. I dunno what I'm gonna do when the boss starts asking why my macros don't work... BUT THEN, I GUESS THAT'S WHY THEY CALL THIS PHASE "REGRETTING HAVING UPGRADED"!!!
0 Likes
Message 33 of 38

arcticad
Advisor
Advisor
Yes it is referring to the operating system.

However, VBA is still a 32 bit application that is "Hacked" to work in 64 bit.

What it does is run out of process. So the program is constantly switching from 64 bit Autocad to an "External" Process running VBA in 32 bit emulation.

The result is my user forms stop working. Code that took 3 seconds to run now takes minutes.

It's practicably unusable.

You must "upgrade" your application to .NET to run it in 64 bit environment.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 34 of 38

muckmailer
Collaborator
Collaborator
What about hours and hours of time to convert the VBA stuff to VB.net vers a few seconds to pop up
a menu on a screen. I would go for the few seconds with slower code. That is the reason Autodesk need
to include both in their packages. Instead the pull out VBA and leave the drafter with nothing in 2010
unless they download the addon, or add VB.net using the MS VB.net package.
0 Likes
Message 35 of 38

arcticad
Advisor
Advisor
I should have been more clear.

It's not a case of "Oh the code runs slower".

It's a case of my userform don't response, ever,
the entire screen goes white and my programs never finish.

And Autodesk has very little to do with VBA not being updated.
This is a Microsoft technology and they have abandoned it.

Also Microsoft is expected to terminate licensing of VBA technology at some point.
Then it won't be available no matter what "Hacks" are used to port it.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 36 of 38

Anonymous
Not applicable
arcticad a écrit :
> Yes it is referring to the operating system.
>
> However, VBA is still a 32 bit application that is "Hacked" to work in 64 bit.
>
> What it does is run out of process. So the program is constantly switching from 64 bit Autocad to an "External" Process running VBA in 32 bit emulation.
>
> The result is my user forms stop working. Code that took 3 seconds to run now takes minutes.
>
> It's practicably unusable.
>
> You must "upgrade" your application to .NET to run it in 64 bit environment.
>
Hi,
I see that, because of the many flavors of Autocad installation, we have
different (bad ) experience with VBA under 2010:
For me, i'm usingf a map version of Autocad, so it's oftenly some
problems different that Autocad alone, combined with an arx extension
(Geomédia Covadis) all under Vista 64 :
My VBA code seems to work at a normal speed, but some Autocad commands
slow down dramaticaly when a VBA project is launched:
especialy the OPEN command when the drawing contains delimited xref (5
to 10 mn ! and many time it crash !) and the _QSAVE, that can freeze
autocad for the same time.
So temporaly i've suppressed the VBA features of my project, and i'm on
the verge of migrate my code to VB.net.
For all my Lisp stuff, it still works properly: I notice that even if
autodesk anouced the death of lisp for around 10 years, lisp is always
embeded with Autocad 2010 (lisp call in menus, express tools ...) so i'm
not to affraid.
Gégé
0 Likes
Message 37 of 38

muckmailer
Collaborator
Collaborator
Well, if possable I guess it is best to stick with the older software.
Looks like another MS created problem.
Most still prefer XP over the newer Vista, looks like this is a simular type
of problem.
0 Likes
Message 38 of 38

Anonymous
Not applicable
arcticad wrote:

> Also Microsoft is expected to terminate licensing of VBA technology
> at some point.

They stopped issuing new licenses about 18mo ago!

Adapt or die!

Terry
0 Likes