Community
[DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acdbGetCurVportTableRecordId@@YA?AVAcDbObjectId@@PAVAcDbDatabase@@@Z")] private extern static ObjectId acdbGetCurVportTableRecordId(IntPtr dbObject); public static ObjectId CurrentViewportTableRecordId(this Database db) { return acdbGetCurVportTableRecordId(db.UnmanagedObject); }
When i call the CurrentViewportTableRecordId function,I get System.AccessViolationException exception.
Any help?
Hi,
why do you use invoking for that? Looking into the object-browser I found (for 17.1):
Public ReadOnly Property CurrentViewportObjectId() As Autodesk.AutoCAD.DatabaseServices.ObjectId
Member von Autodesk.AutoCAD.EditorInput.Editor
Is that also ok? 😉
- alfred -
Thanks for your reply.
But it seems that you cannot P/Invoke the functions wich return an ObjectId value.