Send Command to autocad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys i am trying to Send the MV command to autocad but it doesn't seem to take it can someone help. here is my code.
Using trans As Transaction = db.TransactionManager.StartTransaction()
Dim lyTab As LayerTable = trans.GetObject(db.LayerTableId, OpenMode.ForRead)
If lyTab.Has(".VIEWPORT") Then
doc.Editor.WriteMessage(vbLf & "The Layer Has Already Been Created")
trans.Abort()
Else
lyTab.UpgradeOpen()
Dim lyTr As LayerTableRecord = New LayerTableRecord()
lyTr.Name = ".VIEWPORT"
lyTr.Color = Color.FromColorIndex(ColorMethod.ByLayer, 150)
lyTab.Add(lyTr)
trans.AddNewlyCreatedDBObject(lyTr, True)
doc.Editor.WriteMessage("The Layer: .VIEWPORT has been created Successfully")
trans.Commit()
End If
db.Clayer = lyTab(".VIEWPORT")
trans.Commit()
acdoc.SendStringToExecute("._MV");
the MV command it doesnt want to take