TheSwamp
Code Red => .NET => Topic started by: mkweaver on June 04, 2008, 08:33:22 AM
-
Any suggestions on how to get started with VB.Net? I've installed the Arx SDK, but that doesn't seem to help me with VB. I've tried to install the templates that come with Jerry Winters VB book, but the install fails - works fine on my machine at home (vs2005 Express).
Thanks in advance,
Mike
-
Did you happen to find the vb.net samples in the ARXSDK?
In your project, make sure you have AcDbMgd.DLL and AcMgd.DLL referenced and copy local is set to false (they are in your ACAD directory) .
You may need to add a line like.
Imports Autodesk.AutoCAD.Runtime
...
<CommandMethod("doit")> _
Or
<Autodesk.AutoCAD.Runtime.CommandMethod("doit")> _
-
Also, if you downloaded the ARX SDK for 2009, there is a help file in the Docs folder called arxmgd.chm.
This file has a list of all the managed classes with descriptions.
-
...
Imports Autodesk.AutoCAD.Runtime
...
That did it. I should have seen that one.
Thanks,
Mike
-
...
Imports Autodesk.AutoCAD.Runtime
...
That did it. I should have seen that one.
Thanks,
Mike
My pleasure,
Just a note, Unlike C++ #include declarations, .NET using/import statements do not cause code bloat.
So I just add the items I commonly use.. I.e
C#
#region #Using delarations
using System;
using System.Collections.Generic;
//using System.Linq; //vs2008
using System.Text;
using System.Data;
using System.IO;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
using System.Threading;
using System.Globalization;
using System.Reflection;
using System.Drawing.Imaging;
using Autodesk.AutoCAD.GraphicsInterface;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Windows;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.LayerManager;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Colors;
//using AcExtensions; mine
using AcAp = Autodesk.AutoCAD.ApplicationServices;
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcRx = Autodesk.AutoCAD.Runtime;
using AcDb = Autodesk.AutoCAD.DatabaseServices;
using AcWd = Autodesk.AutoCAD.Windows;
#endregion
[assembly: CommandClass(typeof(ExecMethod.Paths))]
namespace ExecMethod
{
public class Paths
{
...
}
}
PS, get a good C# to VB.NET translator :-)
-
PS, get a good C# to VB.NET translator :-)
You mean there's a good one? :-D
-
what I do, not that its right, and I'm going the other way, is copy paste the VB code into VB Express 2008, compile it, and open that DLL with Reflector and look at it from a C# perspective to get an idea of what I'm supposed to be doing. Hope that gives you some direction