Dimming a BlockRefrence

Discussion in 'AutoCAD' started by Bught, Jan 27, 2005.

  1. Bught

    Bught Guest

    Ok i have code like this:

    Dim oBlkRef As AcadBlockReference
    Set oBlkRef = ThisDrawing.Utility.GetEntity("Select block to rescale:")

    what do i put in place of the ("Select block to rescale:")
     
    Bught, Jan 27, 2005
    #1
  2. This will crash if the user selects anything other than an insert. Use
    an AcadEntity instead then check its type. If incorrect, prompt them for
    another selection.
     
    Frank Oquendo, Jan 27, 2005
    #2
  3. Bught

    fantum Guest

    Check the documentation for the GetEntity method for correct syntax.
     
    fantum, Jan 27, 2005
    #3
  4. GetEntity will not accept anything other than an Object or AcadEntity
    parameter. It's up to you to ensure your user selected the correct type
    of entity.
     
    Frank Oquendo, Jan 27, 2005
    #4
  5. Now that I think about it, I'm not so sure that's a correct statement.
    However, a run-time exception will be thrown using your original code if
    the user picks any other type of object.
     
    Frank Oquendo, Jan 28, 2005
    #5
  6. Bught

    fantum Guest

    In what version of autocad/vba will the original code provide the user with a chance to pick anything?
     
    fantum, Jan 28, 2005
    #6
  7. As written, none. But I'm not being that literal. It's up to each of us
    to know how to correctly call a function so Bught will simply have to
    consult the help for the proper parameters.

    My point is that while GetEntity will allow him to pass an
    AcadBlockReference, it is not a very robust solution.
     
    Frank Oquendo, Jan 28, 2005
    #7
  8. Bught

    fantum Guest

    My point is that while GetEntity will allow him to pass an AcadBlockReference, it is not a very robust solution.

    Seems that would depend on how the error is handled. Run-time errors are not inherently bad, they are a source of information to be used. Failing to make adequate use of that information is bad.
     
    fantum, Jan 28, 2005
    #8
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.
Similar Threads
Loading...