Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AeccXUiLand.AeccApplication.7.0 - Error

19 REPLIES 19
Reply
Message 1 of 20
Anonymous
2589 Views, 19 Replies

AeccXUiLand.AeccApplication.7.0 - Error

We recently switched over to Civil 3D 2011 and have been enjoying all of the new and improved features that AutoDesk has included, but I am having an error with all of the custom programs that require API's. Below is a clip from one of my programs that is causing a Run-time error '-2147221231 (80040111)' - Problem in loading application.

Const sAppName = "AeccXUiLand.AeccApplication.7.0"

Set oAcadApp = ThisDrawing.Application

Set g_oCivilApp = oAcadApp.GetInterfaceObject(sAppName)

In trying to figure out this issue, I tried to run Autodesk's sample VBA program “SurfaceOperationsSample.dvb” and had the exact same error when trying to load the API. This error has occurred on multiple computers, so I can eliminate the thought of a faulty install. Does anyone know if this is just a glitch in 2011 that will require a service pack? Any help would be appreciated.

Thanks,
Cody
19 REPLIES 19
Message 2 of 20
Anonymous
in reply to: Anonymous

C3D2011 uses AeccApplication.8.0

"snow856" wrote in message news:6395510@discussion.autodesk.com...
> We recently switched over to Civil 3D 2011 and have been enjoying all of
> the new and improved features that AutoDesk has included, but I am having
> an error with all of the custom programs that require API's. Below is a
> clip from one of my programs that is causing a Run-time error '-2147221231
> (80040111)' - Problem in loading application.
>
> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>
> Set oAcadApp = ThisDrawing.Application
>
> Set g_oCivilApp = oAcadApp.GetInterfaceObject(sAppName)
>
> In trying to figure out this issue, I tried to run Autodesk's sample VBA
> program “SurfaceOperationsSample.dvb” and had the exact same error when
> trying to load the API. This error has occurred on multiple computers, so
> I can eliminate the thought of a faulty install. Does anyone know if this
> is just a glitch in 2011 that will require a service pack? Any help would
> be appreciated.
>
> Thanks,
> Cody
Message 3 of 20
Anonymous
in reply to: Anonymous

Hit send too quick....
Not only is the Application at Version 8, but the 64bit version of 2011 did
not include the registry entries for the COM libraries....I don't know if
the 32bit version did or not.

The download for the API webcast last week includes a REG file for the x64
version with the required entries. I've attached it to this post.

HTH

"Jeff Mishler" wrote in message
news:6395579@discussion.autodesk.com...
> C3D2011 uses AeccApplication.8.0
>
> "snow856" wrote in message news:6395510@discussion.autodesk.com...
>> We recently switched over to Civil 3D 2011 and have been enjoying all of
>> the new and improved features that AutoDesk has included, but I am having
>> an error with all of the custom programs that require API's. Below is a
>> clip from one of my programs that is causing a Run-time error
>> '-2147221231
>> (80040111)' - Problem in loading application.
>>
>> Const sAppName = "AeccXUiLand.AeccApplication.7.0"
>>
>> Set oAcadApp = ThisDrawing.Application
>>
>> Set g_oCivilApp = oAcadApp.GetInterfaceObject(sAppName)
>>
>> In trying to figure out this issue, I tried to run Autodesk's sample VBA
>> program “SurfaceOperationsSample.dvb” and had the exact same error when
>> trying to load the API. This error has occurred on multiple computers,
>> so
>> I can eliminate the thought of a faulty install. Does anyone know if
>> this
>> is just a glitch in 2011 that will require a service pack? Any help
>> would
>> be appreciated.
>>
>> Thanks,
>> Cody
Message 4 of 20
dnl999
in reply to: Anonymous

I am having a similar problem with Civil 3D 2011 (x64 Windows 7) and in-house routines written in VB6.
the line Set oCustomApp = oAcadApp.GetInterfaceObject(sCustomAppID) is throwing "Problem in loading application" error.
We are not using 2011 version because of this issue. Any idea what might be the problem ?
Where can I download the last week's API webcast file ? TIA.
Message 5 of 20
Anonymous
in reply to: Anonymous

You will need to edit the sCustomAppID value to use the version 8, as well
as update the references used from 7 to 8.

The webcast can be found here:
http://www.adskconsulting.com/adn/cs/api_course_webcast_archive.php

As of now it is the first one listed.

"dnl999" wrote in message news:6395632@discussion.autodesk.com...
> I am having a similar problem with Civil 3D 2011 (x64 Windows 7) and
> in-house routines written in VB6.
> the line Set oCustomApp = oAcadApp.GetInterfaceObject(sCustomAppID) is
> throwing "Problem in loading application" error.
> We are not using 2011 version because of this issue. Any idea what might
> be the problem ?
> Where can I download the last week's API webcast file ? TIA.
Message 6 of 20
Anonymous
in reply to: Anonymous

Thanks for all the responses. We are actually running on Windows XP 32-bit. I see the registration (.reg) for the 64-bit, but have not found anything for the 32-bit. Does anyone know where I could download the registration for the 32-bit. Thanks.
Message 7 of 20
Anonymous
in reply to: Anonymous

I've not heard that the 32 bit version requires a separate reg file. Did you
try the other items noted? Specifically, you must change the string value to
use 8.0 vs 7.0 and you must also change the COM references that the code
uses from version 7 to version 8.

The fact that the VBA sample fails doesn't surprise me. Since they are not
doing any more with VBA it is quite possible it was overlooked for updating
to 2011. In fact, I just opened that VBA sample in 2010 and it is still
showing the references for the 2010 COM objects (version 7.0).

"snow856" wrote in message news:6396540@discussion.autodesk.com...
> Thanks for all the responses. We are actually running on Windows XP
> 32-bit. I see the registration (.reg) for the 64-bit, but have not found
> anything for the 32-bit. Does anyone know where I could download the
> registration for the 32-bit. Thanks.
Message 8 of 20
Anonymous
in reply to: Anonymous

Jeff~

Thanks for the quick response. I am not very familiar with .reg files, so you are probably right that it does not need a separate file. I have changed my line of code to "AeccXUiLand.AeccApplication.8.0" and my reference file to “Autodesk Civil Engineering 8.0 UI Land Object Library” and I am still getting the same error. The only thing that I have not tried, due to my lack of knowledge, is the sCustomAppID value to use version 8. Sorry, I imagine this is basic, but could tell me how to change that version or where to look to see which version it is trying to load. I imagine this will solve my issue. Thanks again for the help.

Cody
Message 9 of 20
Anonymous
in reply to: Anonymous

Sure thing, Cody.

By changing that line of code, you did what I was referring to. I had typed
the other in response to dnl999's question.

When you set the reference to use “Autodesk Civil Engineering 8.0 UI Land
Object Library” you also need to add “Autodesk Civil Engineering 8.0 Land
Object Library”. In addition, make sure to uncheck the references to the
2010 libraries...the ones with the 7.0 in the names.

If this still doesn't get it, I'd be happy to take a look at the file for
you. You can send it direct, and be assured that I will not share it with
anyone. miff AT sonic DOT net


"snow856" wrote in message news:6397109@discussion.autodesk.com...
> Jeff~
>
> Thanks for the quick response. I am not very familiar with .reg files, so
> you are probably right that it does not need a separate file. I have
> changed my line of code to "AeccXUiLand.AeccApplication.8.0" and my
> reference file to “Autodesk Civil Engineering 8.0 UI Land Object Library”
> and I am still getting the same error. The only thing that I have not
> tried, due to my lack of knowledge, is the sCustomAppID value to use
> version 8. Sorry, I imagine this is basic, but could tell me how to
> change that version or where to look to see which version it is trying to
> load. I imagine this will solve my issue. Thanks again for the help.
>
> Cody
Message 10 of 20
Anonymous
in reply to: Anonymous

Jeff~

I have referenced all of the libraries that you mentioned and still the same error. Below is a simple routine that I came up with to quickly change our surface style between tin, existing contours, proposed contours, etc. I am not worried about anyone seeing the code and hope that, if we get it working, it can help someone out.

Sub Surface_Style()

Dim oAcadApp As AcadApplication
Dim g_oCivilApp As AeccApplication
Dim g_oDocument As AeccDocument
Dim g_oDatabase As AeccDatabase

Const sAppName = "AeccXUiLand.AeccApplication.8.0"

Set oAcadApp = ThisDrawing.Application

Set g_oCivilApp = oAcadApp.GetInterfaceObject(sAppName)

If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating " & sAppName & ", exit."
GetGlobalCivilObjects = False
Exit Sub
End If

Set g_oDocument = g_oCivilApp.ActiveDocument
Set g_oDatabase = g_oDocument.Database

GetGlobalCivilObjects = True


Dim oSurface As AeccSurface
Dim Style_Count As Integer
Dim Style_List As String
Dim Surface_Name As String

ThisDrawing.Utility.GetEntity oSurface, varPt, "Pick Surface: "

Style_Count = g_oDocument.SurfaceStyles.Count

With ThisDrawing.Utility
.InitializeUserInput 1, "Proposed Existing Detailed Border Elevations Slopes Tin"
Surface_Name = .GetKeyword(vbCr & "Style Option [Proposed/Existing/Detailed/Border/Elevations/Slopes/Tin]: ")
End With

If Surface_Name = "Existing" Then
Surface_Name = "1' and 5' Background"
ElseIf Surface_Name = "Border" Then
Surface_Name = "Border Only"
ElseIf Surface_Name = "Detailed" Then
Surface_Name = "Detailed Grading (0.2')"
ElseIf Surface_Name = "Proposed" Then
Surface_Name = "1' and 5' Bold Design"
End If

For i = 0 To Style_Count - 1

If Surface_Name = g_oDocument.SurfaceStyles.Item(i).Name Then
oSurface.Style = g_oDocument.SurfaceStyles.Item(i)
End If

Next

End Sub

Let me know if you see something that is referenced wrong. Thanks again for your patience and time.

Cody
Message 11 of 20
Anonymous
in reply to: Anonymous

Hi Cody,
The code as posted doesn't work because there are some Dim calls missing and
it looks like there's a function that's been wrapped into it not quite
right. After editing it a bit it runs just fine. That's why I asked for the
file instead of the code, as the code is just a part of the overall DVB. (To
help catch these errors, make sure that Option Explicit is set for the
modules. That way when you compile it will complain about things not being
right.)

Oh, and I tested on a new, clean install of C3D2011-32bit in WinXpPro. So I
now know that the libraries are properly registered for the 32 bit version.

So if you could post the DVB in a ZIP file, or email it to me direct, I
should be able to get it sorted out pretty quick for you.
Jeff

"snow856" wrote in message news:6397351@discussion.autodesk.com...
> Jeff~
>
> I have referenced all of the libraries that you mentioned and still the
> same error. Below is a simple routine that I came up with to quickly
> change our surface style between tin, existing contours, proposed
> contours, etc. I am not worried about anyone seeing the code and hope
> that, if we get it working, it can help someone out.
>
Message 12 of 20
Anonymous
in reply to: Anonymous

Jeff~

Attached is the .DVB. Sorry for the miscommunication. I would greatly appreciate seeing the edits that you have done with the coding. Luckily, programming is not my full time job, but would take any advice/tip on ways to become better in this field. Thanks again for everything.

Cody
Message 13 of 20
Anonymous
in reply to: Anonymous

OK, no problem. Now we're getting somewhere. 🙂

First off, the code.... As I mentioned before, you should use Option
Explicit at the beginning of the code. This will force the variables to be
Dim'ed and will help to catch errors before running. For future code, if you
go to Tools/Options, on the Editor tab, make sure the Require Variable
Declaration is checked, this will automatically include the Option Explicit
statement in the new module.

Second, the references. It appears you weren't sure about this, as the DVB
didn't have any set. To do this, you must pick Tools in the menu bar (there
are other ways, this is the easiest for me), then References. In the
References dialog will always have 3 preselected for you.... VBA, OLE, & the
current version of Autocad Type Library. You must scroll down and find the 2
Land Libraries for 2011 which are "Autodesk Civil Engineering 8.0 Land
Object Library" & "Autodesk Civil Engineering 8.0 UI Land Object Library"
and place a check next to each of these. Then say OK to dismiss that dialog.

So once I set the references, then commented out the 2 lines that have
GetGloablCivilObjects in them (this is what I meant about the mixing of
functions), then added the Dim statements for varPt & I, the code ran.
Although you may want to make sure the Styles you are using actually exist
in the drawing.....

Since I tested this on another machine, I will post the modified code in a
new message under a different name. OK, not real different....Jeff_M

Jeff

"snow856" wrote in message news:6398786@discussion.autodesk.com...
> Jeff~
>
> Attached is the .DVB. Sorry for the miscommunication. I would greatly
> appreciate seeing the edits that you have done with the coding. Luckily,
> programming is not my full time job, but would take any advice/tip on ways
> to become better in this field. Thanks again for everything.
>
> Cody
>
Message 14 of 20
Jeff_M
in reply to: Anonymous

Here's the modified code:
{code}
Option Explicit ''ADDED

Sub Surface_Style()

Dim oAcadApp As AcadApplication
Dim g_oCivilApp As AeccApplication
Dim g_oDocument As AeccDocument
Dim g_oDatabase As AeccDatabase

Const sAppName = "AeccXUiLand.AeccApplication.8.0"

Set oAcadApp = ThisDrawing.Application

Set g_oCivilApp = oAcadApp.GetInterfaceObject(sAppName)

If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating " & sAppName & ", exit."
''GetGlobalCivilObjects = False '''not needed
Exit Sub
End If

Set g_oDocument = g_oCivilApp.ActiveDocument
Set g_oDatabase = g_oDocument.Database

''GetGlobalCivilObjects = True '''not needed


Dim oSurface As AeccSurface
Dim Style_Count As Integer
Dim Style_List As String
Dim Surface_Name As String
Dim varPt As Variant ''ADDED
Dim i As Integer ''ADDED


ThisDrawing.Utility.GetEntity oSurface, varPt, "Pick Surface: "

Style_Count = g_oDocument.SurfaceStyles.Count

With ThisDrawing.Utility
.InitializeUserInput 1, "Proposed Existing Detailed Border Elevations Slopes Tin"
Surface_Name = .GetKeyword(vbCr & "Style Option [Proposed/Existing/Detailed/Border/Elevations/Slopes/Tin]: ")
End With

If Surface_Name = "Existing" Then
Surface_Name = "1' and 5' Background"
ElseIf Surface_Name = "Border" Then
Surface_Name = "Border Only"
ElseIf Surface_Name = "Detailed" Then
Surface_Name = "Detailed Grading (0.2')"
ElseIf Surface_Name = "Proposed" Then
Surface_Name = "1' and 5' Bold Design"
End If

For i = 0 To Style_Count - 1

If Surface_Name = g_oDocument.SurfaceStyles.Item(i).Name Then
oSurface.Style = g_oDocument.SurfaceStyles.Item(i)
End If

Next

End Sub
{code}
Jeff_M, also a frequent Swamper
EESignature
Message 15 of 20
Anonymous
in reply to: Anonymous

Jeff~

That worked out great. I am just curious about one thing. I created a new file because the old file had a bunch of programs from LDD and that is what I sent over to you. In the original, I did have the Land and UI Land 8.0 checked with no luck. Once I received your file, a second Land and UI Land came into my references, see attached print screen. If I check the references that came in with your file, everything works fine. If I use the existing Land and UI Land, I get the type mismatch error. Do you know why that would happen or why I would now have two different references (one that works and one that doesn’t)? Again thank for salvaging this program and I will use Option Explicit from here on out.

Cody
Message 16 of 20
Anonymous
in reply to: Anonymous

Interesting.... C3D2010 had an issue similar to this, where if you installed
it on a system with 2009 installed it would show that the correct Libraries
were selected when opening an existing project. In fact, only the displayed
name had changed, but scrolling down and reselecting the correct Libraries
solved the problem. Even though it didn't happen for me here, it's entirely
possible that's what you ran into there.

Now that you got this working, time for a heads up in case you haven't seen
it.....

According to Autodesk, this is the last version that your VBA programs will
work with. VBA support is to be dropped in the 2012 product, so now would be
the ideal time to start looking into VB.NET or C#. The learning curve is a
bit steep with either of those, although VB.NET is more similar to VBA so
may be easier to pick up. You can get free editions of the IDE's so there's
no $$ cost involved, just your time. Look for Visual Studio Express Editions
of either VB.NET or C#.

Good luck, and don't hesitate to ask about anything you get stuck on.

Jeff

"snow856" wrote in message news:6398950@discussion.autodesk.com...
> Jeff~
>
> That worked out great. I am just curious about one thing. I created a
> new file because the old file had a bunch of programs from LDD and that is
> what I sent over to you. In the original, I did have the Land and UI Land
> 8.0 checked with no luck. Once I received your file, a second Land and UI
> Land came into my references, see attached print screen. If I check the
> references that came in with your file, everything works fine. If I use
> the existing Land and UI Land, I get the type mismatch error. Do you know
> why that would happen or why I would now have two different references
> (one that works and one that doesn’t)? Again thank for salvaging this
> program and I will use Option Explicit from here on out.
>
> Cody
>
Message 17 of 20
Anonymous
in reply to: Anonymous

Jeff~

I did hear the news. I am going to slowly start to transition to one of the two programming languages. Between the two, which would you suggest for me to start learning? The transition will be slow, but I thought I would start translating all of the old programs to start getting into the new syntax. I also have a few VBA programs within office, in which I will need to convert. Thanks for all the help, it was very much appreciated.

Cody
Message 18 of 20
Anonymous
in reply to: Anonymous

I would suggest C#. It is a bit difficult at first to grasp, but once you
get going with it it can be fun.

Plus, to further entice you, there is a FreeEdition of SincpacC3D for which
the source code, written in C#, is available. Using this will give you a
huge head start in transitioning over, as well as give you usable, working,
code samples that you can build & learn from. A new, updated, version of
this is to be posted in the very near future.

http://www.quuxsoft.com/SincpacC3D_source.aspx

I'm glad I can be of help.

Jeff

"snow856" wrote in message news:6399016@discussion.autodesk.com...
> Jeff~
>
> I did hear the news. I am going to slowly start to transition to one of
> the two programming languages. Between the two, which would you suggest
> for me to start learning? The transition will be slow, but I thought I
> would start translating all of the old programs to start getting into the
> new syntax. I also have a few VBA programs within office, in which I will
> need to convert. Thanks for all the help, it was very much appreciated.
>
> Cody
Message 19 of 20
Anonymous
in reply to: Anonymous

Wonderful.  I just download Visual C# 2010 and a going to start transitioning.  Thanks for all of the great help and guidance. 

 

Cody

Message 20 of 20
Anonymous
in reply to: Anonymous

To solve that problem you have to reference the library placed in the next path:

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 80\AeccXUiLand.tlb

C:\Program Files\Common Files\Autodesk Shared\Civil Engineering 80\AeccXLand.tlb

 

And rewrite:

Const sAppName = "AeccXUiLand.AeccApplication.8.0"

 

I hope I've helped

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report