Hi
Can someone please point in the direction of some vb.net templates for AutoCAD 2016 and VSE 2013? I've installed those supplied on the Autodesk page but there's nothing showing in VSE except a C# template. I need a VB one.
Many thanks
Graham
Hi,
First I'd recommend you to use VS 2015 Community Edition because I do not see any good reason to use prior version and learn c# instead of VB because, as you already experimented, you'll find more examples, samples, templates written in C# than in VB.
Anyway, I think build your own templates is a good way to start learning .NET. Just start an AutoCAD project from scratch and export the template.
I wrote some tutos about building .NET templates for AutoCAD, you can get an English translation for the VB Template from here and for the C# template from there.
I would do what gile suggests as anything he recommends can be taken as excellent advise.
However, here is a link to the AutoCAD .Net Wizards for Visual Studio github project which can you give you a good start on creating/implementing your own.
Thanks for the help and suggestions. Unfortunately learning a brand new language isn't practical at the moment. My background is VBA so to stick with VB is preferable at the moment.
I've got VS 2015 installed as well, and only said about 2013 as the templates from Autodesk for AutoCAD 2016 only work with VS 2013.
graham a écrit :
Thanks for the help and suggestions. Unfortunately learning a brand new language isn't practical at the moment. My background is VBA so to stick with VB is preferable at the moment.
I do not agree, the biggest part of your learning is the .NET environment and the .NET AutoCAD API, in this context learning a new syntax is really not much.
Moreover, learning .NET with an unknown language will allow you to see it as something completely new and will take you away from your habits with VBA.
Anyway, you will be obliged to learn at least reading C# for the reasons mentioned in previous message...
That said, you can do as you want.
graham a écrit :
I've got VS 2015 installed as well, and only said about 2013 as the templates from Autodesk for AutoCAD 2016 only work with VS 2013.
This is one of the reasons I recommend building your own templates in addition to the fact that it teaches you the structure of a project with Visual Studio.
With VS 2015, you can build and use templates for AutoCAD 2007 to 2017.
hi welcome
i concur with everything my estimable colleagues said and would add that: if you already know VBA, and you're planning to dive into VB.NET then quantum leap to c# is miniscule. is purely syntax which you'll pick up easily using the documentation.
I've got a screen cast somewhere showing how to begin but i would strongly urge you to use the template that KeithBrown has suggested u use.
rgds
Bk
I want to ask some follow up questions here regarding VB vs C#.
"I do not see any good reason to use prior version and learn c# instead of VB because, as you already experimented, you'll find more examples, samples, templates written in C# than in VB."
I have to take this comment at face value.
I am new to Visual Studio and programming in general. My only goal is to be able to customize AutoCAD and maybe carry over into some office customization. I had decided to learn Visual Basic because I have read in numerous locations that it is the easiest to learn.
I have started taking an online VB course. (I like it)
Have I mislead myself?
Does this forum generally recommend C# over VB even for a casual learner?
I second what @_gile has suggested having read his posts, and also wholeheartedly concur with @Keith.Brown
I originally learned VBA. switching to c# is really one of the easiest things in the world. you might struggle to write the first few expressions, but given 10 minutes of concerted struggle, i think you'll be ok after that. you probably won't have to think too much especially given the IDE is there to help you. The only thing you might actually be required to read up on is casting - you can explicitly cast in c#. other than that it's basically very similar and the IL code output is exactly the same.
@_gile - i couldn't find an english translation of your tutorials. only french?
@Anonymous
This recommendation is only my personal opinion.
Until now, the differences between VB and C # are essentially syntactic. From this point of view, the choice may be aesthetic, cultural, but should not be preponderant (for my part, I find that the verbosity of VB impedes the immediate comprehension of the code).
Beyond the syntactic difference, VB can be less rigorous than C# depending on the compiler options (for my part, I think that more rigor is preferable in programming).
And above all, as mentioned above, you will find more examples in C # especially for AutoCAD programming (Through the Interface, Drive AutoCAD with Code, AcadNetAddin & More, ...) and, more often, the help on this forum (or others) comes from C# users.
In conclusion, my prefered .NET language would be F# but, due to its confidentiallity, I mostly use C#.
You can translate this page into English using Microsoft Translator from the top left dropdown list.
You can also download templates from this page.
I tried to translate the latest version of the "Create Template" tutorial into English. There are probably still some translation errors.