PDA

View Full Version : Little help with send command



Barry Clark
21st Mar 2005, 04:12 pm
I know there are folks on here that are not fans of the SendCommand, but I still have a question about it.

I have a command string that I can run from the command line for inserting blocks and it pauses on insertion point and rotation.


(command "-insert" "chroma" pause "1" "1" pause)

Now, when I put into VBA, I reformat it like so:


ThisDrawing.SendCommand ("-insert" & vbCr & "chroma" & vbCr & pause & vbCr & "1" & vbCr & "1" & vbCr & pause

What it seems to be doing is humming past the first pause and entering the "1" for scaling as an insertion point. Then it goes to the end and pauses for user input on rotation. What is going wrong here?

Thanks!

rkmcswain
26th Feb 2006, 03:45 am
I don't think the SendCommand is going to let the pause work. Better get the point first, then pass it to the function.

Why use SendCommand in this case anyway?

ASMI
26th Feb 2006, 10:13 am
Sub Chroma_Insert()
ThisDrawing.SendCommand ("(command ""-insert""" & Chr(13) & _
"""chroma"" pause ""1"" ""1"" pause)" & vbCr)
End Sub

:)

rkmcswain
26th Feb 2006, 03:00 pm
Sub InsertChroma()
Dim newBlock As AcadBlockReference
Dim pt As Variant, blk As String
pt = ThisDrawing.Utility.GetPoint(, "Select Point ")
blk = "chroma.dwg"
Set newBlock = ThisDrawing.ModelSpace.InsertBlock(pt, blk, 1#, 1#, 1#, 0#)
End Sub