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
Solved! Go to Solution.
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.
Dim ThisDrawing As Document = Autodesk.AutoCAD.ApplicationServices.Application.D
ocumentManager.MdiActiveDocument Using locked As Autodesk.AutoCAD.ApplicationServices.DocumentLock = ThisDrawing.LockDocument() '' Do something here End Using
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register