Class Module

Class Module

parikhnidi
Advocate Advocate
1,633 Views
4 Replies
Message 1 of 5

Class Module

parikhnidi
Advocate
Advocate

How do I create a class module in .NET? I have started migrating from VBA to .NET and ObjectARX (the later one is bit difficult).

 

May be I can convert the class module I created in VBA here https://forums.autodesk.com/t5/vba/drawing-a-part-with-vba/m-p/9187173/highlight/true#M103374 to .NET version.

 

What I want is to develop a compiled library of various components as a class module. And later on I would like to use this library over and over again in my various application.

 

In archaic VBA world, it was vary easy like adding a class module and then keep them referring. I am sure that it is possible with .NET application, but not sure, how to implement them. I need to define properties similar to Let / Get / Set and methods to execute the codes.

 

Any pointers in this regards?

Thanks,

Nimish

0 Likes
Accepted solutions (2)
1,634 Views
4 Replies
Replies (4)
Message 2 of 5

jabowabo
Mentor
Mentor
Accepted solution

You can create a Class Library in Visual Studio and add the compiled .dll as a reference into any other projects you want to use it in.

0 Likes
Message 3 of 5

parikhnidi
Advocate
Advocate

Just curious. How do I define properties and methods in .NET frameworks. I am radically transforming myself from VB / VBA to .NET (I regret for not doing so for early).

 

Is there any sample example spoecifically dealing with class modules in documentation?

 

Nimish

0 Likes
Message 4 of 5

jabowabo
Mentor
Mentor
Accepted solution
0 Likes
Message 5 of 5

Norman_Yuan
Mentor
Mentor

A point to note on @jabowabo provided link: it is about .NET Core (now .NET 5). While the way of creating a class in code is the same (in C#), for AutoCAD .NET API development, you use .NET Framework, not .NET Core/Standard.

 

Also, based on the question you asked here and in ObjectARX forum, I suggest you need to spend quite some time to get started with basic .NET framework (a few weeks/months, depending on how fask you can learn) before tackling AutoCAD .NET API development. While you can use any .NET language (VB.NET, C#, F#, Iron Python.NET), yu should choose C#, instead of VB.NET, which you might be thinking it would be more natural to transit from VBA to VB.NET. I'd say, ObjectARX C++, as you asked in the other forum, sounds definitely not for you.

 

Norman Yuan

Drive CAD With Code

EESignature