We are planning on upgrading to Civil 3D 2017 and I have some legacy VBA programs that I would like to upgrade (if I still can). From previous upgrades, I have always had to revised the following lines of code to the current version of Civil 3D:
Public Const sAeccApp = "AeccXUiLand.AeccApplication.10.3"
Set oAeccApp = ThisDrawing.Application.GetInterfaceObject(sAeccApp)
The 10.3 was for 2014 and I'm looking for what it would be for 2017.
I have a hunch that it's supposed to be 11.0, but when I enter it, I get the error message "Type mismatch" as opposed to the "Problem in loading application" error I get with any other value.
Anyone know what I'm doing wrong?
Can you still run Civil 3D VBA in 2017?
Any help would be appreciated.
Thanks,
Jeff
In Civil 3D type in the command AECCVERSION. You will see something like this after a number of DBX files.
FileVersion: 10,5,604,0
The Application version you will need is the first 2 numbers , in this case (for C3D 2016) it would be 10.5, I think 2017 is 11.0 but you should use this method to double check. Ooops, I see you guessed 11.0, did you try just 11?
I just ran some code I use when testing lisp which verified that it should be 11.0, as this works fine:
(setq acApp (vlax-get-acad-object)) (setq C3D (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) ) C3D (vl-registry-read C3D "Release") C3D (substr C3D 1 (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1)) ) ) (vla-getinterfaceobject acApp (strcat "AeccXUiLand.AeccApplication." C3D) )
And that returns this:
#<VLA-OBJECT IAeccApplication 0000000061e6a1f0>
Command: !c3d
"11.0"
Jeff, I went ahead and installed the VBA enabler for 2017. You need to set the 2017 references from the tlb files, don't use the ones offered in the References dialog. Browse to the tlb files in C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 110| and add the 2 for Land. It should then work as expected.
I thought I had recalled seeing a help file, blog post, or similar that mentions this, but a quick search didn't come up with anything.
Thanks Jeff.
I was able to get it working after playing with how I loaded the references. I appreciate your help!