Can any1 give a clue to me how to make a drawing active and perform required activity and close the document.
I have a collection of drawings which are opened one by one and the user is asked to pick a point to place the required component.
My program is not able to make the document active for the user to edit
instead it is present as an active file at the background.
Below is the code can you please help me in this.
For Each lCTempObject In ldwgFolder
lactiveFilename = lCTempObject
If lactiveFilename.EndsWith("dwg") Or lactiveFilename.EndsWith("DWG") Then
ldwgfilename = lactiveFilename.Substring(lactiveFilename.LastIndexOf("\") + 1)
larryavai = larrMasterBOMlist.Contains(lactiveFilename)
If larryavai = True Then
lCActiveDoc = Application.DocumentManager.Open(lactiveFilename, False)
lCLock = lCActiveDoc.LockDocument(DocumentLockMode.ProtectedAutoWrite, Nothing, Nothing, True)
lCActiveDB = lCActiveDoc.Database
lCActiveTransMan = lCActiveDB.TransactionManager
lCActiveTrans = lCActiveTransMan.StartTransaction
lCActiveBlockTable = lCActiveTrans.GetObject(lCActiveDB.BlockTableId, OpenMode.ForWrite)
Dim prPosRes, luserpt As PromptPointResult
Dim usercon As New Point3d
luserpt = Application.DocumentManager.MdiActiveDocument.Editor.GetPoint("Select a Point to place the Item Callout")
usercon = New Point3d(luserpt.Value.X, luserpt.Value.Y, luserpt.Value.Z)