Programming Languages in the future of Autocad?

Programming Languages in the future of Autocad?

dvertz
Collaborator Collaborator
1,180 Views
14 Replies
Message 1 of 15

Programming Languages in the future of Autocad?

dvertz
Collaborator
Collaborator
I have recently read that VBA is depreciated in 2010.

I have been very busy writing a new program in VBA and I am currently only about half way complete. I have been writing all of my programs in LISP & DCL up until I started with this program. Back in the day of the BASIC programming language, I had a good understanding of the language and was able to make the move to Visual Basic when that came out. I pretty much knew I would not have any trouble writing my new program in VBA. I chose to make that move because the options need for the program were to intense that to use DCL (which puts so much space between the controls) was not feasible.

Now with VBA on its way out, I have to question should I waste my time to complete the project? Or should I just start over with another language?

From what I see so far there doesn't seem to be too many choices. LISP (VLISP), ObjectARX, VSTA (the replacement for VBA).

I have tried writing code in the C++ language before. I couldn't get the hang of it. And from what I have read, .NET is very similar and so is the VSTA. This tells me that VSTA is designed for professional programmers rather than the typical user of Autocad.

Where's the future going with a language that the ordinary user can write his own simple programs? VBA was something almost everyone could use. It is simple and easy to understand the code.

I'd like to here some feedback or suggestions. I need a language as easy as LISP or VBA to understand yet give me controls like TextBoxes and ComboBoxes of VBA.
Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
1,181 Views
14 Replies
Replies (14)
Message 2 of 15

Anonymous
Not applicable
Hi dvertz,

It has been stated categorically by a senior Autodesk staffer that VBA
is shipped with Civil 3D 2010, but I'm unsure of any rumours about
vanilla AutoCAD. However, there is a lot a code in VBA and removing it
from AutoCAD would lead to some fairly serious upset and until I see it
on an Autodesk web site, I would not pay too much heed to blogs and rumours.

Look at it this way.

"You have a site with 500 AutoCAD licences which uses a VBA program
which increases your productivity by 20% compared with standard AutoCAD.

You discover VBA won't work in the next version of AutoCAD - would you
upgrade?"


Despite asking for ages when VSTA will be included with AutoCAD, the
only answers received from Autodesk have been the equivalent of a blank
stare.

The worst problem with VBA is that it is 32 bit, and it has speed issues
in the 64 bit versions of AutoCAD. I've never seen any test data which
documents the speed loss, so can't guide you as to how significant it
will be.

Regards


Laurie Comerford

dvertz wrote:
> I have recently read that VBA is depreciated in 2010.
>
> I have been very busy writing a new program in VBA and I am currently
> only about half way complete. I have been writing all of my programs in
> LISP & DCL up until I started with this program. Back in the day of the
> BASIC programming language, I had a good understanding of the language
> and was able to make the move to Visual Basic when that came out. I
> pretty much knew I would not have any trouble writing my new program in
> VBA. I chose to make that move because the options need for the program
> were to intense that to use DCL (which puts so much space between the
> controls) was not feasible.
>
> Now with VBA on its way out, I have to question should I waste my time
> to complete the project? Or should I just start over with another language?
>
> From what I see so far there doesn't seem to be too many choices. LISP
> (VLISP), ObjectARX, VSTA (the replacement for VBA).
>
> I have tried writing code in the C++ language before. I couldn't get the
> hang of it. And from what I have read, .NET is very similar and so is
> the VSTA. This tells me that VSTA is designed for professional
> programmers rather than the typical user of Autocad.
>
> Where's the future going with a language that the ordinary user can
> write his own simple programs? VBA was something almost everyone could
> use. It is simple and easy to understand the code.
>
> I'd like to here some feedback or suggestions. I need a language as easy
> as LISP or VBA to understand yet give me controls like TextBoxes and
> ComboBoxes of VBA.
0 Likes
Message 3 of 15

Anonymous
Not applicable
There are many flavors of .NET, one of which is VB.NET. I haven't switched over to it yet as the express version (free) of Visual Studio 2008, from what I understand, won't work with with AutoCAD 2004. I'm guessing that the VSTA is the integrated development environment which will let you choose your programming flavor. I'd recommend browsing the .NET forum and picking up a thick book on VB.NET. A decent link is http://msdn.microsoft.com/en-us/beginner/default.aspx
0 Likes
Message 4 of 15

Anonymous
Not applicable
dvertz wrote:

> Now with VBA on its way out, I have to question should I waste my
> time to complete the project? Or should I just start over with
> another language?

I recommend you move to VB.NET today. Most non-AutoCAD aspects aren't
that hard and you'll be somewhat productive from day one. The
interface to AutoCAD is radically different but once you get over that
hump your home free. Get Jerry Winters book to help with that, its far
from perfect but well worth the price.

Having spent most of the last 9mo porting VBA code to .NET (with 3mo to
go) I wouldn't recommend anyone use VBA to create new code.

Move now, prepare for some speed bumps, and you'll never look back!

Terry
0 Likes
Message 5 of 15

arcticad
Advisor
Advisor
I would have to Agree.

VBA runs out of process in 64 bit and as a result runs 100 times slower then in 32 Bit Autocad. I did my own tests and code that took 3 seconds to run in 32 bit took over 10 minutes in 64 bit. This makes the program completely useless. Time wise and also forms don't respond correctly. When clicking on a modeless forms, they wouldn't always respond.

From what I have read in 2010 32 bit VBA will be supported. However it won't be included in the box and 'may' have the same slow down issues.

You need to start your code in .net now, otherwise you will have to rewrite it again very soon.

It's like the year 2000 switch all over again.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 6 of 15

Anonymous
Not applicable
Hi arcticad,

Would you care to post the code you used for the test?

Does it need a specific drawing? If so could you enclose it with the
code so that your results can be cross-checked.

Regards


Laurie Comerford

arcticad wrote:
> I would have to Agree. VBA runs out of process in 64 bit and as a result
> runs 100 times slower then in 32 Bit Autocad. I did my own tests and
> code that took 3 seconds to run in 32 bit took over 10 minutes in 64
> bit. This makes the program completely useless. Time wise and also forms
> don't respond correctly. When clicking on a modeless forms, they
> wouldn't always respond. From what I have read in 2010 32 bit VBA will
> be supported. However it won't be included in the box and 'may' have the
> same slow down issues. You need to start your code in .net now,
> otherwise you will have to rewrite it again very soon. It's like the
> year 2000 switch all over again.
0 Likes
Message 7 of 15

Anonymous
Not applicable
It seems that there are some interesting workarounds that bentley microstation 64bit vba users have come up with to continue using vba. I wonder if some of which would / could work with 2010, but alas it will be a while before i'll find out 😛
0 Likes
Message 8 of 15

Anonymous
Not applicable
You don't have to post your code, or results.

The probelem is well-known and about as bad as you describe it.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm


wrote in message news:6126242@discussion.autodesk.com...
I would have to Agree. VBA runs out of process in 64 bit and as a result
runs 100 times slower then in 32 Bit Autocad. I did my own tests and code
that took 3 seconds to run in 32 bit took over 10 minutes in 64 bit. This
makes the program completely useless. Time wise and also forms don't respond
correctly. When clicking on a modeless forms, they wouldn't always respond.
From what I have read in 2010 32 bit VBA will be supported. However it won't
be included in the box and 'may' have the same slow down issues. You need to
start your code in .net now, otherwise you will have to rewrite it again
very soon. It's like the year 2000 switch all over again.
0 Likes
Message 9 of 15

Anonymous
Not applicable
Hi Tony,

Yes! No doubt the 'problem' was measured with your spell checker.

Since numerous posters here have 'casually' indicated slowness values
different by over an order of magnitude, it would not hurt to see some
real values.

Obviously, no-one has to post code if they don't want to, but it would
be interesting to many readers to see some genuine numbers and the code
features on which they are based.

Regards


Laurie Comerford

Tony Tanzillo wrote:
> You don't have to post your code, or results.
>
> The probelem is well-known and about as bad as you describe it.
>
0 Likes
Message 10 of 15

Anonymous
Not applicable
Laurie Comerford wrote:

> Since numerous posters here have 'casually' indicated slowness values
> different by over an order of magnitude, it would not hurt to see
> some real values.

Its bad, my personal observations were 10x slower on VBA code. But what
got me moving was that the loading of any VBA code, even issuing the
VBAMAN command and closing it on 64bit caused AutoCAD commands to run 6x
slower. I personally timed a large array before/after issuing VBAMAN
and found it was running 6x slower.

So it was the entire system slowdown that got me in a learning/porting
rush, I wasn't going to be responsible for that. With a massive
collection of VBA code, I'm 75% done and loving VB.NET. I'll admit I've
still got a lot to learn but I learn a little more everyday.

Adapt or die! VBA is dead, time to move on.

Terry
0 Likes
Message 11 of 15

Anonymous
Not applicable
Just curious, Have you tried accessing the IDE from microsoft office suite? as opposed to vbaman? and not suggesting it, just curious, running an autocad macro from, say excel?

thanks
0 Likes
Message 12 of 15

Anonymous
Not applicable
geez your posts always come off so rude to me... is that their intention? or is it unintentional, and a sign of something else, maybe it would be helpful to read the posts one last time before they are posted and ask, will this come off the wrong way, will this offend anyone, is this being posted to be constructive and to help answer the OP's questions or for some other reason?

so one 64bit user says 100 times slower (3x100=10mins+) another says 10 times slower

i'm convinced of the necessity to switch to .NET, but it is interesting that millisecond programs will still take less than a second, even with inefficient programming techniques
0 Likes
Message 13 of 15

arcticad
Advisor
Advisor
I had a simple program that would scan through each object in the drawing and change its color.

It was a really simple program. I don't know exactly how much slower it is but it was seconds vs minutes.

I don't need to post any code.

The speed issue seemed to be the least of the problems for me.

Simply trying to click a button becomes an issue because they don't always register a mouse click.

Besides speed the main advantage for working in .net is that you have better access to the new object types, Such as Walls and Doors.

More objects are exposed and you can dock your forms.
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 14 of 15

dvertz
Collaborator
Collaborator


First I would like to thank everyone for their replies. It has been interesting and helpful reading.

Since Laurie had made the point of the larger firms that use VBA might not make an upgrade if VBA was missing from the program, it seemed logical that it may be not included it in any beta or demo versions to keep downloads managable. I have seen that happen before. It seems likely that it would be packaged with the final DVD. Albeit, they may make it an optional load like the Express Tools were at one time.

Now if the code does run slower, I don't see it as a huge deal breaker. Lets face it, most cases any program where the computer is working for you will still be faster than doing all the work manually.

When the subject kept pointing to VB.NET, I decided to look it up. At the MSDN site, I found information about Visual Basic 2008, Visual Basic 10 and Visual Studio .NET. But I can't find where they mention VB.NET. I am a casual writer (not professional, yet) and can't justify a purchase of a professional program. Is there a free version like there is for Visual Basic 2008 Express?

Also, if Autodesk is moving to VSTA, then will there be an editor added to Autocad?

Civil 3D 2022,
Windows 10 Pro, x64, Nvidia Quadro P1000
Intel Core i9-11900k; 3.50GHz, 32 GB RAM, 500GB WD BLACK M.2


0 Likes
Message 15 of 15

Anonymous
Not applicable

VB.net is just a generic term for the VB language
used to program against the .NET framework.
The current version is Visual
Basic 2008. Visual Studio is an IDE which includes each of the
.NET languages
and the native version of C++.
 
You will need to get a good
understanding of VB and the .NET framework before you can comfortably
attack
the Autocad managed libraries. Download the Express version of VB 2008 - which
is free -
and start learning. There is plenty of info on the Microsoft web
site to help you out - including
newsgroups. You can use the Express IDEs to
program Autocad and it won’t cost you anything but a
bunch of your well spent
time.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">


First I would like to thank everyone for their replies. It has been
interesting and helpful reading.

Since Laurie had made the point of the
larger firms that use VBA might not make an upgrade if VBA was missing from
the program, it seemed logical that it may be not included it in any beta or
demo versions to keep downloads managable. I have seen that happen before. It
seems likely that it would be packaged with the final DVD. Albeit, they may
make it an optional load like the Express Tools were at one time.

Now
if the code does run slower, I don't see it as a huge deal breaker. Lets face
it, most cases any program where the computer is working for you will still be
faster than doing all the work manually.

When the subject kept pointing
to VB.NET, I decided to look it up. At the MSDN site, I found information
about Visual Basic 2008, Visual Basic 10 and Visual Studio .NET. But I can't
find where they mention VB.NET. I am a casual writer (not professional, yet)
and can't justify a purchase of a professional program. Is there a free
version like there is for Visual Basic 2008 Express?

Also, if Autodesk
is moving to VSTA, then will there be an editor added to
Autocad?

0 Likes