Highlight

Discussion in 'AutoCAD' started by mgrigoriev, Jul 13, 2004.

  1. mgrigoriev

    mgrigoriev Guest

    Hi,
    I can't figure out what is with the highlight command. Help says: "Once the highlight flag for an object has been set, a call to the Update or Regen method is required to view the change."
    The following code is supposed to highlight my object, but it doesn't:
    Obj.Highlight True
    Obj.Update
    It does the opposite. Update sets highlight to false.
    Here's what I am doing: I pick an object on the screen, do some calculations and then delete the object. I can't make the selected object highlight unless I pick another object or put a message box. What can I do???
    Thanks,
    Mike
     
    mgrigoriev, Jul 13, 2004
    #1
  2. Hi Mike, the help seems to be incorrect. I don't use update and it works. Just tried with update it does what you say. I would suggest the help is actually meant to warn against using update or regen.
    Regards - Nathan
     
    Nathan Taylor, Jul 14, 2004
    #2
  3. mgrigoriev

    mgrigoriev Guest

    Nathan, what do you do to make it show your object highlighted? If I just say obj.highlight(true) it won't do it on the screen. Say, when I draw a line with addline, the line won't show until I update it. The same thing is with the highlight. The object is virtually highlighted, but on the screen it is still not.
     
    mgrigoriev, Jul 14, 2004
    #3
  4. mgrigoriev

    Tim Arheit Guest

    The help may not be completely off. Try using Application.Update
    rather than Obj.Update.

    The following works for me:

    Sub aaa()
    Dim Wall As Object
    Dim PickedPoint As Variant, TransMatrix As Variant, ContextData As
    Variant
    Dim strPrmt As String
    'Pick The House Wall
    strPrmt = vbCrLf & "Pick The House Wall: "
    ThisDrawing.Utility.GetSubEntity Wall, PickedPoint, TransMatrix,
    ContextData, strPrmt
    Wall.Highlight True
    Application.Update ' Wall.Update does not work here.
    Call MsgBox("test")
    End Sub


    -Tim
     
    Tim Arheit, Jul 15, 2004
    #4
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.