.NET

Reply
Distinguished Contributor
Posts: 140
Registered: ‎04-12-2005
Message 1 of 3 (247 Views)
Accepted Solution

Lock Document

247 Views, 2 Replies
09-11-2013 09:52 AM

I am using AutoCAD 2014 and vb.net 2010 and coverting code from 2010 to 2014.

 

This like does not work anymore.

 

Using locked As Autodesk.AutoCAD.ApplicationServices.DocumentLock = ThisDrawing.LockDocument()

 

Any clue as to why?

 

These are the lines for ThisDrawing

 

Public ReadOnlyProperty ThisDrawing() AsDocument

       

Get

           

ReturnApplication.DocumentManager.MdiActiveDocument.GetAcadDocument()

       

EndGet

   

EndProperty

*Expert Elite*
Posts: 1,982
Registered: ‎04-29-2006
Message 2 of 3 (234 Views)

Re : Lock Document

09-11-2013 10:51 AM in reply to: cadcamm99

Hi,

 

It looks like you are confusing COM and .NET APIs.

 

This Drawing is AcadDocument type which is a COM object that do not have a LockDocument() method.

The .NET Document class has a this method.

Gilles Chanteau
Distinguished Mentor
BlackBox_
Posts: 701
Registered: ‎02-25-2013
Message 3 of 3 (226 Views)

Re: Lock Document

09-11-2013 11:02 AM in reply to: cadcamm99
Dim ThisDrawing As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument

Using locked As Autodesk.AutoCAD.ApplicationServices.DocumentLock = ThisDrawing.LockDocument()

     '' Do something here

End Using

 



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community