+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Apr 2004
    Posts
    147

    Default Little help with send command

    Registered forum members do not see this ad.

    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.

    Code:
    (command "-insert" "chroma" pause "1" "1" pause)
    Now, when I put into VBA, I reformat it like so:

    Code:
    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!
    A baby seal walks into a club....

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,639

    Default

    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?

  3. #3
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    Code:
    Sub Chroma_Insert()
    ThisDrawing.SendCommand ("(command ""-insert""" & Chr(13) & _
    """chroma"" pause ""1"" ""1"" pause)" & vbCr)
    End Sub

  4. #4
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,639

    Default

    Registered forum members do not see this ad.

    Code:
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts