When an object is inserted from Design Center I would like it automatically exploded. The code below works for DIMLINEAR but doesn't seem to catch the -INSERT command:
Public Sub cmdEnded(ByVal o As Object, ByVal e As CommandEventArgs)
If bEditCommand = False Then
Return
End If
bEditCommand = False
'Set flag to bypass OpenedForModify handler
bDoRepositioning = True
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Try
If e.GlobalCommandName = "DIMLINEAR" Then 'this one works fine
Application.DocumentManager.MdiActiveDocument.SendStringToExecute("LAYERP" & vbCr, True, False, True)
End If
If e.GlobalCommandName = "_-INSERT" Then 'doesn't work 😞
Application.DocumentManager.MdiActiveDocument.SendStringToExecute("EXPLODE" & vbCr & "L" & vbCr & vbCr, True, False, True)
End If
Catch ex As System.Exception
ed.WriteMessage("Error in cmdEnded: " + ex.Message)
End Try
End Sub