VBA Insert a block

Discussion in 'AutoCAD' started by Tim Robben, Jan 28, 2005.

  1. Tim Robben

    Tim Robben Guest

    I have to make a VBA routine, for inserting a block:

    I made this, but it doesn't work.

    Does anybody knows how I could fix it?

    Sub InsertBlock()
    ' Insert the block
    Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(, , "vkb.dwg", 1,
    1, 1, 0)
    End Sub
     
    Tim Robben, Jan 28, 2005
    #1
  2. Tim Robben

    Jeff Guest

    Sub blocktest()
    Dim oBlkRef As AcadBlockReference
    Dim dPt(2) As Double
    Dim sName As String

    sName = "c:\testblock.dwg"
    Set oBlkRef = ThisDrawing.ModelSpace.InsertBlock(dPt, sName, 1#, 1#, 1#, 0#)
    End Sub
     
    Jeff, Jan 30, 2005
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.