0 Members and 1 Guest are viewing this topic.
Dictionary<AcRtm.RXClass, Type> mngTypeDict = new Dictionary<AcRtm.RXClass, Type>();//Names of RXClasses, which do not have manage wrapper.StringBuilder sb = new StringBuilder();foreach (DictionaryEntry item in AcRtm.SystemObjects.ClassDictionary) { AcRtm.RXClass rx; Type type; AcRtm.RXObject obj; try { rx = (AcRtm.RXClass)item.Value; obj = rx.Create(); if (obj != null) { type = obj.GetType(); mngTypeDict.Add(rx, type); } else sb.AppendLine(rx.Name); } catch (Exception ex) { //oops.. }}
INTERNAL ERROR: !dbAnnotationScaleCollectioni.cpp@37: eNullObjectPointer
var rx = item.value as AcRtm.RXClassif (rx != null) obj = rx.Create();
I apologize if AcRtm is an AutoCAD class but I cannot find anything documenting it. Is this a custom class?
obj = rx.Create(IntPtr.Zero);
Autodesk.AutoCAD.Runtime is the namespaceAcRtm is an alias you're using to represent that namespace.
I didn't see it in the documentation but with Object BrowserCode - C#: [Select]Autodesk.AutoCAD.Runtime.DisposableWrapper.Create(System.Type, System.IntPtr, bool)Autodesk.AutoCAD.Runtime.RXObject.Create(System.IntPtr, bool)
Constructor on type 'System.Object' not found.
Some untested code? Code - C#: [Select] ... Type type = rxclass.GetRuntimeType(); ...
Am I inventing a bicycle, maybe? I need to get wrapper type for each RXClass in Database. Is exists a simple and fast (for speed) solution to do it?
Before AutoCAD 2013, the only way was to create an instance of the wrapper class, and even that wasn't foolproof if the native ARX that provides it is not available (then an ImpDBObject wrapper is created).In AutoCAD 2013, RXClass has a new method that returns the managed wrapper type.