Creating Block and associated object data from External Program...

Discussion in 'AutoCAD' started by Carlos Santillan, Nov 19, 2003.

  1. Hi,
    I am trying to create a block and associate object data from an
    external executable.

    I create my block using InsertBlock. this returns a Block reference.
    After the block is created I create the object data. (the object data
    table has the same name as the layer, and the block)


    set pAcadBlockRef = m_pAcadMSpace.InsertBlock(varPoint,
    bstrACADLayerName, dblScale, dblScale, 1.0, dblOrientation);

    This works and the block is created.
    Now to create the Object Data

    Set objTable = m_objProj.ODTables.Item(tblindx)
    Set objRecords = objTable.GetODRecords
    objRecords.Init(pAcadBlockRef ,True, False)
    Set ObjNewRow = objTable.CreateRecord()

    Populate the fields.

    When this line is reached.
    result = ObjNewRow.AttachTo(pAcadBlockRef.ObjectID)

    VB displays

    Runtime Error '1001':
    AutoCad MAP error.

    Any ideas what I could be doing wrong?


    Thanks
     
    Carlos Santillan, Nov 19, 2003
    #1
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.