In this post, let us look at the RXClass in a bit detail and see what it can give us when programming with AutoCAD .NET. Then we may find good use of it in the future.
Here is the test command and code to inspect at the RXClass for the Circle class:
<CommandMethod("RxClassInfo")> _
Public Shared Sub RxClassInfo_Method()
Dim ed As Editor = MgdAcApplication.DocumentManager.MdiActiveDocument.Editor
Dim rxClass__1 As RXClass = RXClass.GetClass(GetType(Circle))
Dim str As String = "RXClass info for Circle:" & vbLf
str += String.Format(vbTab & "Name: {0}" & vbLf, rxClass__1.Name)
str += String.Format(vbTab & "DxfName: {0}" & vbLf, rxClass__1.DxfName)
str += String.Format(vbTab & "AppName: {0}" & vbLf, rxClass__1.AppName)
str += String.Format(vbTab & "ClassVersion: {0}" & vbLf, rxClass__1.ClassVersion)
str += String.Format(vbTab & "Parent: {0}" & vbLf, rxClass__1.MyParent.Name)
str += String.Format(vbTab & "ProxyFlags: {0}" & vbLf, rxClass__1.ProxyFlags)
str += String.Format(vbTab & "AutoDelete: {0}" & vbLf, rxClass__1.AutoDelete)
str += String.Format(vbTab & "IsDisposed: {0}" & vbLf, rxClass__1.IsDisposed)
ed.WriteMessage(str)
End Sub
Here is the output:
Command: RxClassInfo
RXClass info for Circle:
Name: AcDbCircle
DxfName: CIRCLE
AppName: ObjectDBX Classes
ClassVersion: 19.0.0.0
Parent: AcDbCurve
ProxyFlags: 0
AutoDelete: False
IsDisposed: False
So the name of the RXClass can be expected as the prefix AcDb plus the AutoCAD .NET class name and the DxfName is the upper cases of the .NET class name. The AppName seems always to be ObjectDBX Classes for AutoCAD native classes. The ClassVersion is 19.0.0.0 here though the test command/code was run in an AutoCAD 2012 (internal/registry version 18.2). The parent RXClass of the Circle is AcDbCurve as can also be expected. The ProxyFlags is 0 indicating Circle is not from a third party or the application (such as the ObjectDBX) defining it is being loaded and enabled. The AutoDelete and the IsDisposed are straightforward.
The leading edge AutoCAD .NET Addin Wizard (AcadNetAddinWizard) provides various project wizards, item wizards, coders and widgets to help program AutoCAD .NET addins.
Recent Comments