Message 1 of 3
calling autoCAD commands in VB.NET while CommandFlags.session is enabled
Not applicable
01-23-2016
12:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to call "-laydel" command from vb.net code. However I am getting error when using 'commandflags.session. How can I call an autocad command in vb.net while commandflags.session is enabled? I need to keep commandflags.session for my application. please see part of my code below:
<CommandMethod("cmdLaydel", CommandFlags.Modal + CommandFlags.Session)>
Public Sub deleteLayers2()
Dim layerTodel As String = Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("USERS2")
Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim ed As Editor = doc.Editor
ed.Command("-laydel", "n", layerTodel, "", "y", "")
End Sub
Alumni