broken dimcontinue

Discussion in 'AutoCAD' started by Jorge Jimenez, Apr 28, 2004.

  1. Hi everyone.

    I made a VB6 dll which amongst other things
    places dimensiones on a specified layer.

    In the application begin_command event I store the dimcommand name
    Later, in the end_command event, I check to see if the ending command is
    the one I stored, if so, I move the recently added object(s) to the proper
    layer.

    This works fine for all dims

    But, if DIMSCALE is < 1 then the DIMCONTINUE command fails
    with a "Extension line origins cannot be equal" error message.

    My app does not change any dimvars or any other setting anywhere else
    and the only change is made AFTER the command ends, and it's just a layer
    change.

    If I uninstall my app, dimcontinue works fine.

    Any ideas ??
     
    Jorge Jimenez, Apr 28, 2004
    #1
  2. This is really strange !!

    If my app was messing up the DIMCONTINUE it would
    fail all the time but,
    doing further testing, the problem happens when DIMSCALE = 0.8
    but NOT when DIMSCALE = 0.5.

    Also, the problem happens when DIMSCALE = 1.8
    but NOT when is equal to 1.5 or 2.0

    How about that for a riddle !!!
     
    Jorge Jimenez, Apr 29, 2004
    #2
  3. Jorge Jimenez

    Wayne Craig Guest

    Jorge,

    Try running the DIMSTYLE command (dialog version, not the command line one)
    before you execute your code. You don't have to actually do anything in the
    Dimension Style Manager dialog...just open and close it. I had a similar
    problem with continuous dimensions misbehaving after executing some LISP
    code. Initializing the Dimension Style Manager seemed to correct the
    problem. Good luck.

    Wayne



    Dimension Style Manager must initialize a
     
    Wayne Craig, Apr 29, 2004
    #3
  4. Thanks for the advice Wayne.
    I tried it, but it didn't make a difference.

    The dimcontinue seems to be unable
    to hook to an existing dimension
    so it visually shows it's starting point
    to be equal to it's ending point
    even before I can click anywhere.

    Funny thing, if I use the undo option
    inside the DIMCONTINUE command
    it automatically hooks to the last dimension
    and it shows the correct distance to the point
    where the cursor is, but as soon as I move
    the mouse it unhooks and goes back
    to showing a zero distance as I move the mouse.
     
    Jorge Jimenez, Apr 29, 2004
    #4
  5. Jorge Jimenez

    Wayne Craig Guest

    Jorge,

    That looks to be about the same behavior that I have seen. Have you tried
    the Dimension Style Manager *after* your routine runs?

    Wayne
     
    Wayne Craig, Apr 29, 2004
    #5
  6. Yes I did.
    It didn't make any difference.

    The dll is loaded at the beginning of the AutoCAD session
    and released when AutoCAD closes.
    This is because it includes plot logging and dwg open and close logging

    I have debugged the dll and nothing else is going when the dimcontinues
    starts and stops.
    I have even disabled the begin and end command events, and still dimcontinue
    does not work.
     
    Jorge Jimenez, Apr 30, 2004
    #6
  7. Jorge Jimenez

    Perion Guest

    If you completely disable your BeginCommand and EndCommand handler subs and
    recompile and save the dll, shutdown Acad , then start back up - does it still
    screw up the same way as before?

    Are there other application events that you are handling besides BeginCommand
    and EndCommand?

    It's hard to imagine how, as you stated, "the problem happens when DIMSCALE =
    0.8 but NOT when DIMSCALE = 0.5.
    Also, the problem happens when DIMSCALE = 1.8 but NOT when is equal to 1.5 or
    2.0" This is really weird!

    Is that the symptom even when you've disabled the two event handlers?

    Perion
     
    Perion, Apr 30, 2004
    #7
  8. If you completely disable your BeginCommand and EndCommand handler subs
    and
    YES, completely disabled, all code comented, nothing is touching the dim
    commands or any other command.
    Even went as fas as dimming Public MyAcadDoc as AutoCAD.AcadDocument instead
    of Public WithEvents MyAcadDoc as AutoCAD.AcadDocument
    This leaves only the application object events, EndOpen and NewDrawing which
    add the drawings to a document array class (this is where MyAcadDoc is
    declared), and SysvarChanged which monitors changes to "clayer" variable in
    the middle of a dimcommand and sets a global variable to true.
    Still, the dimcontinue fails.
    I start a new drawing. Set dimscale (through the dimstyle dialog) to 1.8
    make a Linear Dimension just fine. Then use the DIMCONTINUE and it fails
    Sometimes it behaves fine in a first drawing, but if I open a new one
    (second document) the DIMCONTINUE will fail, and if I switch to the first
    drawing, the DIMCONTINUE will now fail on the drawing where it had worked
    fine at the beginning. From then on, the dimcontinue will remain broken for
    the rest of the acad session.
    Now, if I change the dimscale back to 1 or 2, the dimcontinue command works
    just fine in all drawings.

    YES, those explained above.
    Yeah, you bet it's weird ! I have seen many weird stuff in my time, but this
    tops it all !!!
    Why only with dimcontinue ?? Why not with any value of dimscale ??
    YES
     
    Jorge Jimenez, Apr 30, 2004
    #8
  9. Another interesting thing thats happening:
    While I'm debugging the dll, the dimcontinue command seems to behave
    correctly
    If I compile and install, and start AutoCAD (without the dll running in the
    ide), the dimcontinue fails.
     
    Jorge Jimenez, Apr 30, 2004
    #9
  10. Jorge Jimenez

    Perion Guest

    Some dll compiler setting kicking in the compilation process?

    Suppose you create a new dll (using the same compiler settings) that just
    displays a MsgBox (maybe saying "Now in my Test Sub" or something like that) and
    trigger it on the AppActivate event. This event fires when the AutoCAD
    application receives focus. To trigger the event just switch focus from AutoCAD
    to another Windows application and then back again. If dimcontinue works its
    probably not a compiler setting. If dimcontinue works try changing it from being
    an AppActivate handler to a BeginCommand handler - same MsgBox, recompiling with
    the same settings. Just trying to narrow in on which parts of either the code or
    compiler settings is screwing Acad. [I wouldn't be suprised if there isn't a bug
    in Acad. There was a bug in a previous Acad version where DIMCONTINUE and
    DIMBASELINE would not recognize a previous dimension after a UCS change. They
    also wouldn't reference a previously deleted dimension. That was fixed and it
    was a long time ago.

    Anyway, if it messes up with the new, simpler dll then maybe play with the
    compiler settings.
    ???? I dunno. Interesting problem though.

    Perion
     
    Perion, Apr 30, 2004
    #10
  11. I'll try your suggestions and let you know.
    Thanks for the help.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica
    (sorry, phony e-mail, SPAM made me do it)

     
    Jorge Jimenez, Apr 30, 2004
    #11
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.