HandleToObject Error

Discussion in 'AutoCAD' started by bart1123, Dec 29, 2004.

  1. bart1123

    bart1123 Guest

    I am trying to use the HandleToObject method to change the width of a selected Pline. When I use the code below I get the following error:
    Method 'HandleToObject' of object 'IAcadDocument' failed

    Any suggestions? This is a VBA Macro in Map2000i

    <<Code Snipit Starts Here>>>>
    Public Sub LineWeight(sHandle As String)
    Dim tempPLine As AcadObject
    Dim tempMapOpt As AutocadMAP.ProjectOptions
    Set tempPLine = ThisDrawing.HandleToObject(sHandle) 'error happens here

    tempMapOpt.DontAddObjectsToSaveSet = True

    tempPLine.ConstantWidth = 7
    tempMapOpt.DontAddObjectsToSaveSet = False



    End Sub
    <<Code Snipt Ends Here>>>

    Thanks in advance
    Bart
     
    bart1123, Dec 29, 2004
    #1
  2. Not what you wanted to here but it works perectly here except for the lines with 'tempMapOpt.DontAddObjectsToSaveSet =' because the variable is declared but has nothing assigned. I am using Map 2005 and never had any problems with 2004.
    Regards - Nathan
     
    Nathan Taylor, Dec 29, 2004
    #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.