Nubie build errors

Nubie build errors

smichels
Enthusiast Enthusiast
1,152 Views
8 Replies
Message 1 of 9

Nubie build errors

smichels
Enthusiast
Enthusiast

I'm new and dont know visual basic enough to fix the two build errors im getting. Can anyone help me out. 

Thanks in advance

Here is the code

0 Likes
Accepted solutions (1)
1,153 Views
8 Replies
Replies (8)
Message 2 of 9

norman.yuan
Mentor
Mentor
Accepted solution

Well, the compiling error occurred in FordGlobalTitleBlock.vb file, which is not shown in your picture. I guess if you open it in the code window, you would find the "Imports Autodesk.AutoCAD.Interop" direction is missing on top.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 9

smichels
Enthusiast
Enthusiast

Ok thanks i will try your solution. Thank you

0 Likes
Message 4 of 9

smichels
Enthusiast
Enthusiast

How do i add direction to AutoCAD.Interop

0 Likes
Message 5 of 9

norman.yuan
Mentor
Mentor

As I said, you need to place:

 

Imports Autodesk.AutoCAD.Interop

 

on top of the FordGlobalTitleBlock.vb, just as you did in the Form1.vb, as your picture showed.

 

By the way, at this point of time, in terms of .NET technology's development/progress, starting .NET programming with VB.NET might not be a wise choice, if you are planning to keep working in this field. 

 

Also, it seems you are doing a stand-alone EXE app that controls a running AutoCAD session. In most cases, this is hardly a good app, of course, unless you are only focusing on learning as newbie, not a real world app solution.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 6 of 9

smichels
Enthusiast
Enthusiast

My mistake thanks

0 Likes
Message 7 of 9

smichels
Enthusiast
Enthusiast

The build was successful I added this to the top and am getting this error

There is no Imports Autodesk.AutoCAD.Interop option on top of the FordGlobalTitleBlock.vb

Thank you for helping

smichels_0-1736014462718.pngsmichels_1-1736014506410.pngsmichels_2-1736014538785.png

 

 

0 Likes
Message 8 of 9

norman.yuan
Mentor
Mentor

It is VERY IMPORTANT TO MAKE IT CLEAR: your app is targeting AutoCAD 2025, or AutoCAD 2024 or earlier. It is only clear to see the pictures of your later reply, or the attached VS project, that you are indeed targeting AutoCAD 2025.

 

AutoCAD 2025 uses .NET 8, not .NET Framework. So, your Visual Studio project is wrong, where you .NET Framework 3.5, and added AutoCAD 2025's COM API reference by letting VS to generate the AutoCAD COM .NET Interop DLL, which is .NET 8 based. That is why you saw the error when running your app: it uses .NET Framework runtime and trying to load the AutoCAD .NET interop of .NET8.

 

You should create a .NET 8 EXE project and then add AutoCAD 2025's COM interop DLLs. When adding AutoCAD COM interop DLLs, you do not have to use "COM" tab in the "Add References" dialog; you simply click "Browse" button and navigate to the AutoCAD 2025 install folder (C:\Program Files\Autodesk\AutoCAD 2025\" and select "Autodesk.AutoCAD.Interop.dll" and "Autodesk.AutoCAD.Interop.Common.dll".

 

Again, since you are "newbie", and probably mainly focusing on programming for AutoCAD 2025 or later, DO NOT WASTE time on VB.NET, Microsoft has stopped VB.NET advancement since .NET6 already.

 

As I previously suggested, using standalone EXE to control AutoCAD session via AutoCAD COM API is rarely a good application solution. If you have just started learning, then learning AutoCAD .NET API is much better time/energy investment.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 9 of 9

smichels
Enthusiast
Enthusiast

Makes perfect sense. I will try that. 

Thanks again. 

0 Likes