Unfortunately, that's one of the problems with using
SendCommand() in AutoCAD 2000. In later versions, the
SendCommand() method will execute the command before
the macro ends, but AutoCAD will still repeat the last
command issued by SendCommand(), rather than the LISP
command that started the macro, if you press enter
afterwards
One solution is the Command() method in AcadX.arx
(www.caddzone.com/acadx/acadx15.htm).
The macro below shows how it can be used to solve
this problem. There is one requirement, which is
that the macro is started using (vla-runmacro) rather
than (vl-vbarun) or the VBARUN command.
Public Sub AttEditDemo()
Dim Ent As AcadEntity
Dim BlockRef As AcadBlockReference
Dim PickPt As Variant
ThisDrawing.Utility.GetEntity Ent, PickPt
Set BlockRef = Ent
Dim Editor As New AcadXDrawingEditor
Editor.Command Array("._DDATTE", BlockRef)
' Just to show that the MACRO can do something
' after DDATTE is finished.
PickPt = Utility.GetPoint(, "Center: ")
ModelSpace.AddCircle PickPt, 2#
ModelSpace.AddCircle PickPt, 3#
End Sub
Start the macro like this:
(defun C:ATTEDITDEMO ()
(vla-runmacro (vlax-get-acad-object) "AttEditDemo")
(princ)
)
"Chad"
wrote in message
news:FFE8815F83CD48160E26DB4BAD7C5366@in.WebX.maYIadrTaRb...
> I have called it from a lisp command so I can re-run it with an enter or
> right mouse click.
> When I call a sendcommand it becomes the last command run from the command
> line, so therefore the sendcommand command is run, not the lisp that calls
> the VBA.
> If you have any suggestions, please fire away.
>
> Thanks,
> Chad.
>
> "Tony Tanzillo" wrote in message
> news:CCFAA65C102414E144A2BBF10A89594D@in.WebX.maYIadrTaRb...
> > Why do you find it necessary to avoid using SendCommand() ?
> >
> > "Chad" wrote in message
> > news:C8F147EE6CB29C096EC461FBE57A7253@in.WebX.maYIadrTaRb...
> > > Is it possible to display the attributes dialog for a block via VBA
> > without
> > > using the send command and 'attedit'?
> > > Maybe using the blockref object somehow.
> > >
> > > TIA,
> > > Chad.
> > >
> > >
> >
> >
>
>