Hi,
Now I have to problem to cancel current command, now the situation is, I create a palette with list box. when user click a item in the listbox, I will insert a block, draw line/pline, etc according the item user picked. My problem is, when user pick the 1st item, my function in the palette will ask to pick a point, at this time, if user pick another item, I need to cancel 1st function.
I tried, acedPostCommand(Chr(3)) which will cancel previous one which is fine, but it also cancel current one.
I use the listbox SelectedIndexChanged event (code attached0.
I am thinking to check CMDACTIVE system variable and found it is not in the .net. so how I can check when should I send ^C to cancel the command?
both
acedPostCommand(Chr(3) + Chr(3) + Chr(3))
acedPostCommand(Chr(3))
not working
I really appreciate your help. thank you very much
[code]
Private Sub lstItems_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstItems.SelectedIndexChanged
'' debug
'DDebug.WriteLog("IRRAPalette.lstItems_SelectedIndexChanged: " & _drvData.Row("item_name"))
If _IsInit Then Exit Sub
If lstItems.SelectedIndex > -1 Then
_drvData = lstItems.SelectedItem
'' ^C^C^C
'acedPostCommand(Chr(3) + Chr(3) + Chr(3))
acedPostCommand(Chr(3))
Dim myPart As New MyPart
' Insert
myPart.Insert(_drvData)
End If
End Sub
[/code]
Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023