support vba in Civil 3D 2011 ?

support vba in Civil 3D 2011 ?

dnl999
Advocate Advocate
3,991 Views
21 Replies
Message 1 of 22

support vba in Civil 3D 2011 ?

dnl999
Advocate
Advocate
I have some VBA routines I downloaded and some were created in our office.
Some were written for Civil 3D 2006-2008 and we had to modify them to work in 2010.
Are we able to use these in Civil 3D 2011 ? I heard there was a drastic change in the Civil 3D api in 2011 version.
TIA.
0 Likes
3,992 Views
21 Replies
Replies (21)
Message 2 of 22

Anonymous
Not applicable
Similar to AutoCAD 2010, there is an extension that is installed to use VBA with AutoCAD (which includes C3D)

However, I would STRONGLY encourage you to move from VBA. The improvements to the API for C3D is focused on the .Net API and with Microsoft's deprecation of VBA, it is not good to be leaning too much on this for the future.

You would also have to change your COM references in the VBA projects.

Josh Modglin
InMotion Consulting
http://inmotioncon.com
0 Likes
Message 3 of 22

dnl999
Advocate
Advocate
Thank you for your reply.
Yes, it would be better to learn the emerging technology and plan for the future, but I hope Autodesk still allows the use of existing technology for some time, at least until I retire 🙂
0 Likes
Message 4 of 22

GTVic
Advisor
Advisor
For 2011 it is unsupported but provided as a download. For 2012 the VBA IDE will be gone. The activex api will remain for some time so activex code will still run. So if you have a compiled exe that should still work. I'm not clear if you will be able to load and run a DVB based macro though. Definitely you won't be able to create/edit a DVB in 2012.
0 Likes
Message 5 of 22

Anonymous
Not applicable
Hi Greg,

Either you are making this up, or you are breaking a Non-disclosure
agreement.

Which one is it?


Regards,


Laurie Comerford

greg.toews wrote:
> For 2011 it is unsupported but provided as a download. For 2012 the VBA IDE will be gone. The activex api will remain for some time so activex code will still run. So if you have a compiled exe that should still work. I'm not clear if you will be able to load and run a DVB based macro though. Definitely you won't be able to create/edit a DVB in 2012.
>
0 Likes
Message 6 of 22

GTVic
Advisor
Advisor
Nice comment, either I am a liar or a cheat by your logic. Apologize and I'll discuss.
0 Likes
Message 7 of 22

Anonymous
Not applicable
Hi Greg,

If I'm wrong of course I'll apologise.


Regards,


Laurie Comerford



Greg.Toews wrote:
> Nice comment, either I am a liar or a cheat by your logic. Apologize and I'll discuss.
>
0 Likes
Message 8 of 22

GTVic
Advisor
Advisor
Hi Laurie,

Regardless of whether you are wrong or not, a baseless accusation is not acceptable behaviour.

Enjoy reading, fourth paragraph from the bottom:

[http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=12729484&linkID=9240618]

Greg
0 Likes
Message 9 of 22

Anonymous
Not applicable

Hi Greg,



I have say you are right at the moment and I do apologise for
anticipating normal Autodesk behaviour and assuming you had gone beyond
it.



To quote from the web page:



"How long will VBA continue to be available for AutoCAD-based
applications?


There are no current plans to distribute VBA for AutoCAD-based
applications beyond the AutoCAD 2011 release."



Autodesk have left it open to change their minds with the word
"Current" if there is sufficient client reaction to this announcement.





Regards,





Laurie Comerford



Greg.Toews wrote:

Hi Laurie,

Regardless of whether you are wrong or not, a baseless accusation is not acceptable behaviour.

Enjoy reading, fourth paragraph from the bottom:

[http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=12729484&linkID=9240618]

Greg


0 Likes
Message 10 of 22

Sinc
Advisor
Advisor
> {quote:title=Greg.Toews wrote:}{quote}
> Regardless of whether you are wrong or not, a baseless accusation is not acceptable behaviour.

I don't think Laurie was intentionally being acerbic. When I saw your post, I also thought you were releasing restricted information, because the last official word I heard from Autodesk made a very strong point about not releasing this information yet. Autodesk was very clear that they were not ready for public disclosure yet.

They silently posted that page on their website without informing us that we can now talk about this point. It was something of a surprise.

-- Sinc
http://www.ejsurveying.com
http://www.quuxsoft.com
Sinc
0 Likes
Message 11 of 22

GTVic
Advisor
Advisor
No problem, I did verify that you cannot even run an existing VBA routine via VLISP without the add-on. But you can paste your code into an Excel VBA module and run it from there if you are careful with your declarations.

Greg
0 Likes
Message 12 of 22

GTVic
Advisor
Advisor
I posted the info because I saw a post by an Autodesk employee mentioning that it would not be supplied for 2012. This was in response to a question about 2011. To be honest I couldn't remember where I saw the post but since it was after the 2011 release and based on the casual way that it was mentioned I was fairly certain that this was ok to be made public.

Since I couldn't find the post, I was thankful that I found the FAQ when I googled to save my reputation. 🙂
0 Likes
Message 13 of 22

MikeEvansUK
Advisor
Advisor
VBA IDE not being in a release would be a real pain, during the 2011 Beta I tried programming in Visual studio Express only to find that in x64 you cannot use the edit and continue functions (or I could not find any method to do so) so I gave up as it was not worth the hassle and worked under 2010 instead.

I don't know if edit and continue works for the VBA IDE under x64 but if that is the only way to do it I'll do my coding in that or under x86 and upgrade it in VSE.

The other issue I can see is when creating subassemblies, it is easier to create and run them under the VBA IDE as you can see and follow the code as it runs, unable to do so in VS Express.

Most minor users have probably dabbled in VBa at some time or another and to remove the IDE from the application would probably put all but the hardened users off learning this valuable skill. (Or perhaps that's the intention?)

Anyhow, to remove the IDE before Edit and continue is available under x64 would be a bad idea. Hopefully VSE 2010 or 11 will get this before hand.
Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes
Message 14 of 22

Anonymous
Not applicable
FWIW, I have never been able to use Edit & Continue under any circumstances
with .NET dll's. If you have, I'd be interested in hearing how.....

You CAN step through the code as it runs in Debug mode, watch the variables
fill, examine what is in the variables, etc. Just unable to edit anything
until C3D is closed.

"MIKEEVANS" wrote in message news:[email protected]...
> VBA IDE not being in a release would be a real pain, during the 2011 Beta
> I tried programming in Visual studio Express only to find that in x64 you
> cannot use the edit and continue functions (or I could not find any method
> to do so) so I gave up as it was not worth the hassle and worked under
> 2010 instead.
>
> I don't know if edit and continue works for the VBA IDE under x64 but if
> that is the only way to do it I'll do my coding in that or under x86 and
> upgrade it in VSE.
>
> The other issue I can see is when creating subassemblies, it is easier to
> create and run them under the VBA IDE as you can see and follow the code
> as it runs, unable to do so in VS Express.
>
> Most minor users have probably dabbled in VBa at some time or another and
> to remove the IDE from the application would probably put all but the
> hardened users off learning this valuable skill. (Or perhaps that's the
> intention?)
>
> Anyhow, to remove the IDE before Edit and continue is available under x64
> would be a bad idea. Hopefully VSE 2010 or 11 will get this before hand.
0 Likes
Message 15 of 22

Anonymous
Not applicable
Hello mikeevans,
Visual Studio in 64bit is what does not allow Edit & Continue, the step through
code and variable watch works fine though. The Edit/Continue problem on 64bit
is not fixed in VS2010 either. This is really a sore thumb for all developers
(not just Autodesk developers)

The VBA IDE decision is really Microsofts (not Autodesk), they (supposedly)
stopped the development and new licensing a few years ago.
They did update it from I believe 6.0 to 6.5, but only for use within MS
Office. What is interesting is that after telling ISV for years that VBA
wouldn't be supported ever in 64bit, is they've gone and created VBA 7 for
Office 2010 in 64bit but have not made it available to ISVs.

What I've been doing is using a 32bit VM when I need Edit/Continue functionallity.
(Don't really need it that often).

The fact is VBA is going away in 2012 (existing VBA code will stop working,
there will be no seperate download enabler) so time spend on VBA code at
this time is pretty much wasted and a dead end if you ever plan to upgrade
Autocad.



> VBA IDE not being in a release would be a real pain, during the 2011
> Beta I tried programming in Visual studio Express only to find that in
> x64 you cannot use the edit and continue functions (or I could not
> find any method to do so) so I gave up as it was not worth the hassle
> and worked under 2010 instead.
>
> I don't know if edit and continue works for the VBA IDE under x64 but
> if that is the only way to do it I'll do my coding in that or under
> x86 and upgrade it in VSE.
>
> The other issue I can see is when creating subassemblies, it is easier
> to create and run them under the VBA IDE as you can see and follow the
> code as it runs, unable to do so in VS Express.
>
> Most minor users have probably dabbled in VBa at some time or another
> and to remove the IDE from the application would probably put all but
> the hardened users off learning this valuable skill. (Or perhaps
> that's the intention?)
>
> Anyhow, to remove the IDE before Edit and continue is available under
> x64 would be a bad idea. Hopefully VSE 2010 or 11 will get this before
> hand.
>
0 Likes
Message 16 of 22

Anonymous
Not applicable
On 4/16/2010 11:50 AM, Jeff Mishler wrote:

> FWIW, I have never been able to use Edit& Continue under any circumstances
> with .NET dll's. If you have, I'd be interested in hearing how.....

I have been using E&C extensively in VS 2005 with AutoCAD 2007, and
32bit versions of Civil3D for years. I can add breakpoints, make almost
any changes I want and continue. Even adding additional cases to select
case that I couldn't do in VBA. An estimated 98% of the time I can
continue, it seems like edits very near the line of executing code can
break it. I can't imagine life without it.

I start VS 2005 Pro, in the Debug section:

Config: Active (Debug)
(o) Start Ext Prog: C:\Prog...\acad.exe
Working Dir: C:\Prog...

Then use the play button (Start Debugging) which loads AutoCAD, netload
my DLL (or automate that) and start the commands, etc.

Of course I've never been able to E&C with any 64bit version of AutoCAD.

Terry
--
Never start any job without the right tools!
AutoCAD Add-on Tools at http://www.dotsoft.com
0 Likes
Message 17 of 22

Anonymous
Not applicable
On 4/16/2010 1:32 PM, Michael Robertson wrote:

> The VBA IDE decision is really Microsofts (not Autodesk), they
> (supposedly) stopped the development and new licensing a few years
> ago.

But have they stopped allowing existing licensees to continue with the
last version available, I doubt it.

I believe the fact that Autodesk must pay Microsoft some amount on each
new license (others pay $50 in small quantities) is the LEADING (but not
exclusive) factor in Autodesk's decision. In my opinion "Follow the
money" applies here.

Terry
0 Likes
Message 18 of 22

Sinc
Advisor
Advisor
> {quote:title=Guest wrote:}{quote}
> I have been using E&C extensively in VS 2005 with AutoCAD 2007, and
> 32bit versions of Civil3D for years. I can add breakpoints, make almost
> any changes I want and continue. Even adding additional cases to select
> case that I couldn't do in VBA. An estimated 98% of the time I can
> continue, it seems like edits very near the line of executing code can
> break it. I can't imagine life without it.

I, too, am curious about how you are managing this. Can you do it with VS 2008 and Civil 3D 2008? VS 2005 and C3D 2009? What breaks it?

I, too, have never seen any ability like this. In my experience, I must build a DLL and netload it into C3D, and I cannot change the DLL or reload it until I shut down and restart Civil 3D.

-- Sinc
http://www.ejsurveying.com
http://www.quuxsoft.com
Sinc
0 Likes
Message 19 of 22

Anonymous
Not applicable
I'm able to E&C. You have to go into properties and then set the program to
launch on debug as shown in the attached image. I've been running the debug
at the dll level and not the entire project. I think that's the only changes
I made to get it to work. As Terry mentions it doesn't work for 64-bit
applications due to Microsoft not supporting it.
0 Likes
Message 20 of 22

MikeEvansUK
Advisor
Advisor
Jeff,

It depends what VB app you are using, I found it very difficult to do using Express versions of Visual Studio at first intil I found this "hack" but the Pro version handles this as Christopher explains.

For the Express version you have to edit the ***.user file and add / edit the following text to suit your Civil installation path.

It will then allow Edit and continue for the most minor changes, some additions or changes still require a restart.

Edited by: MIKEEVANS on Apr 19, 2010 8:33 AM
XML was bing changed. Annoyance so I have attached a file.

PS Thanks for the info Michael and Terry, I thought it was an AutoDesk app but obviously not. Shame but I'll just keep an older version intact to run until a fix is available. Edited by: MIKEEVANS on Apr 19, 2010 8:36 AM
Mike Evans

Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB

0 Likes