BeginCommand ()

BeginCommand ()

Anonymous
Not applicable
285 Views
2 Replies
Message 1 of 3

BeginCommand ()

Anonymous
Not applicable
I was wondering why this module is not working. ?
thanks
I have a end command and begin plot reactor set, which work, but this
does not

Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
On Error Resume Next
Select Case CommandName
Case "plot"
ThisDrawing.SendCommand "(SetPlotStamp)" & vbCr
End Select
End Sub
-

Nauman M
PC TroubleShooters
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.mysorewala.com
0 Likes
286 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Dollars to donuts the string case you're using doesn't match the command name:
"plot" vs. "PLOT". Try this:

Select Case LCase(CommandName)
...
End Select

--
http://www.acadx.com
"Thank goodness! I thought my boots were cracked."

"Nauman M" wrote in message
news:[email protected]...
> I was wondering why this module is not working. ?
> thanks
> I have a end command and begin plot reactor set, which work, but this
> does not
>
> Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
> On Error Resume Next
> Select Case CommandName
> Case "plot"
> ThisDrawing.SendCommand "(SetPlotStamp)" & vbCr
> End Select
> End Sub
> -
>
> Nauman M
> PC TroubleShooters
> Need to easily Navigate to your Custom Content Folders?
> Need Autolayering for Dimensions without going through Design Center?
> Download the updated ADT Tools for ADT 2 & 3 at
> http://www.mysorewala.com
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi Nauman,

If you throw that routine into debug mode by setting a breakpoint at

Select Case CommandName

then checking the value of the CommandName string you will find that
it is all caps. This is the way that AutoCAD represents commands internally.

Solution: Change "plot" to "PLOT"

--
Joe Sutphin
Author of "AutoCAD 2000 VBA Programmers Reference"
ISBN #1861002564

Checkout Sources - The magazine dedicated to AutoCAD customization
http://vbdesign.hypermart.net/sources/sources.htm

"Nauman M" wrote in message
news:[email protected]...
> I was wondering why this module is not working. ?
> thanks
> I have a end command and begin plot reactor set, which work, but this
> does not
>
> Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
> On Error Resume Next
> Select Case CommandName
> Case "plot"
> ThisDrawing.SendCommand "(SetPlotStamp)" & vbCr
> End Select
> End Sub
> -
>
> Nauman M
> PC TroubleShooters
> Need to easily Navigate to your Custom Content Folders?
> Need Autolayering for Dimensions without going through Design Center?
> Download the updated ADT Tools for ADT 2 & 3 at
> http://www.mysorewala.com
0 Likes