.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to P/Invoke acdbGetCurVportTableRecordId for AutoCAD 2008?

2 REPLIES 2
Reply
Message 1 of 3
csharpbird
329 Views, 2 Replies

How to P/Invoke acdbGetCurVportTableRecordId for AutoCAD 2008?

        [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?

2 REPLIES 2
Message 2 of 3

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3

Thanks for your reply.

But it seems that you cannot P/Invoke the functions wich return an ObjectId value.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost