Rudy, Doug, Jeff.....let's start this over

Discussion in 'AutoCAD' started by rewilson, Feb 14, 2004.

  1. rewilson

    rewilson Guest

    I started a new post because the last was getting really hard to keep up with........at least for me. Question is this: I really like Doug's idea about tracking command usage. Can that be done? If so, how would I go about doing it? The idea of unloading RD4 if an image isn't present is Ok, but I can't get the code to work. Of course, I'm probably not doing something right. Any input on this is greatly appreciated.
    Thanks to everyone,
    Russ
     
    rewilson, Feb 14, 2004
    #1
  2. rewilson

    Jeff Mishler Guest

    Hi Russ,
    I am driving to my Northern base today (I commute long distance) and
    will have some time to think about this. Maybe in my 9 hour drive I'll
    come up with something....

    Jeff

    up with........at least for me. Question is this: I really like Doug's
    idea about tracking command usage. Can that be done? If so, how would I
    go about doing it? The idea of unloading RD4 if an image isn't present
    is Ok, but I can't get the code to work. Of course, I'm probably not
    doing something right. Any input on this is greatly appreciated.
     
    Jeff Mishler, Feb 14, 2004
    #2
  3. rewilson

    rewilson Guest

    Thanks Jeff. Drive carefully. Something else to think about. The unload code loops back thru and unloads even (if (= a t)
    or (if a (princ (prompt "\nImage Found"))). It still goes back through the drawings and when it gets the one without an image, it unloads RD4. I'm sure it's something minor that I'm not seeing. When I animate it, it seems to be in a continuous loop searching for an image. Thanks again for your help. Be safe.
     
    rewilson, Feb 14, 2004
    #3
  4. rewilson

    Doug Broad Guest

    To track command usage, a commandended reactor could
    check the command name just ended and if it is a rasterdesign
    command it could save the current time. The same command
    reactor could check the counter if the command is not a
    rasterdesign command and if more than a certain time exists,
    it could display a screen asking the user if he wants to
    continue using rasterdesign. If the user answers yes, the
    timer could be reset(save current time), otherwise you have
    users implicit permission to run the unload process.




    like Doug's idea about tracking command usage. Can that be done? If so, how would I go about doing it? The idea of unloading RD4 if
    an image isn't present is Ok, but I can't get the code to work. Of course, I'm probably not doing something right. Any input on this
    is greatly appreciated.
     
    Doug Broad, Feb 15, 2004
    #4
  5. rewilson

    rewilson Guest

    Thanks Doug,
    That could work very well. I don't understand how you set up the reactors to recognize rasterdesign commands,though. Would I have to create a list of all the rasterdesogn commands? TIA
     
    rewilson, Feb 16, 2004
    #5
  6. rewilson

    Doug Broad Guest

    Yes. Exactly and <unsure>perhaps their aliases</unsure>.


    to create a list of all the rasterdesogn commands? TIA
     
    Doug Broad, Feb 16, 2004
    #6
  7. rewilson

    Jeff Mishler Guest

    Hi Russ,
    I made it back home OK. Thanks.

    Here is a revised code that will search all open drawings in the current
    Acad session (in other words it won't search other instances of Acad that
    may also be open), and will unload RD4 only if no images are found in any of
    the open drawings. If an image is found in any one of them, no unload will
    be attempted.

    Doug's idea of a reactor is great, but I've never written one for lisp so I
    won't be much help there. However, I think that that can be done in VBA and
    I have done something similar in that medium......

    Jeff

    (defun c:rd4needed? (/ a)
    (setq a nil)
    (vlax-for doc (vla-get-documents (vlax-get-acad-object))
    (vlax-for ent (vla-get-modelspace doc)
    (if (= (vla-get-objectname ent) "AcDbRasterImage")
    (setq a t)
    ); if
    ); for ent
    ); for doc
    (if a
    (alert "Image(s) found! RD4 left alone.....")
    (command "_iunload");this executes if no images found, a is nil
    ); if
    (princ)
    )


    code loops back thru and unloads even (if (= a t)
    drawings and when it gets the one without an image, it unloads RD4. I'm sure
    it's something minor that I'm not seeing. When I animate it, it seems to be
    in a continuous loop searching for an image. Thanks again for your help. Be
    safe.
     
    Jeff Mishler, Feb 16, 2004
    #7
  8. rewilson

    rewilson Guest

    I'm intrigued by the thought of this, so I'd like to hear more on how to do it. What data do I need to collect to create the list?
    I realize I need the commands, but how would I create the list? (setq lst (????????)).......or is that even the correct way to create it? This is way over my head, but I think I need to pursue it. Thanks for your help, Doug.
     
    rewilson, Feb 17, 2004
    #8
  9. rewilson

    rewilson Guest

    That's it, Jeff! Works like a charm. I see the difference in the original code, too. I still want to investigate the other method (with the timer) though, because I think it would be more functional from a user standpoint. If I do it this way, and a user opens a vector drawing initially, the RD4 is gone. Then if he has to open a hybrid drawing to get some piece of info off of it, he will have to restart AutoCad. This will work for the intitial software push, but let's talk more about the timer option. By the way............glad you made it safely. Do you make that drive weekly?
     
    rewilson, Feb 17, 2004
    #9
  10. rewilson

    Doug Broad Guest

    The command list should be in your help file.
    It might actually be easier to implement in VBA.

    Without writing it for you:
    1) vlr-command-reactor has a commandended event.
    2) vlr-set-notification can be used to make the reactor
    react to commands issued while other documents are active.
    3) vlr-editor-reactor has a beginclose event that you need
    to use to remove the reactor when its host drawing is
    closed.
    4)The primary commandended callback should look something
    like:

    (defun covcmdchk (r cl)
    ;;D. C. Broad - Commandended callback demonstration
    (if (member (car cl)
    ;;Sample command list for Cad Overlay
    '("AUTORUB" "IABOUT" "ICLEAR"
    "ICLEARALL" "IOPTIONS" "ICONVTOIMG"
    "ICONVOLVE" "ICOPYSS" "ICROPCIRC"
    "ICROPDIAG" "ICROPLINE" "ICROPPOLY"
    "ICROPRECT" "IDELETE" "IDESKEW"
    "IDESPECKLE" "IDISPLACE" "IEXPORT"
    "IFRAME" "IHISTOGRAM" "IIMERGE"
    "INEW" "IINFO" "IINSERT"
    "IINVERT" "IMANAGE" "IMATCH"
    "IMASK" "IMERGETOIMG" "IMIRROR"
    "IPRIMFROMVEC" "IREFINEMODE" "IRUBARC"
    "IRUBCIRC" "IRUBDIAG" "IRUBDONUT"
    "IRUBLINE" "IRUBPLINE" "IRUBRECT"
    "ISARC" "ISAVE" "ISAVEAS"
    "ISCALE" "ISCIRCLE" "ISDIAGREG"
    "ISEBRCON" "ISEBRSMART" "ISLINE"
    "ISMOOTH" "ISNAP" "ISPOLYREG"
    "ISRECTREG" "IREGFROMVEC" "IREMOVE"
    "ITRANSPARENT" "IVMERGE" "RPENS"
    "VARC" "VCIRCLE" "VCONTOUR"
    "VLINE" "VPLINE" "VRECT"
    "VTEXT" "VTOOLS"
    )
    )
    (covreset r) ;;reset the timer on the reactor
    (covcheck r) ;;Check timer for inadequate use.
    )
    )

    Depending on how the rasterdesign commands are implemented,
    the command names should show up like ACAD commands.

    Hope that helps.



    data do I need to collect to create the list?
    (????????)).......or is that even the correct way to create it? This is way over my head,
    but I think I need to pursue it. Thanks for your help, Doug.
     
    Doug Broad, Feb 17, 2004
    #10
  11. rewilson

    rewilson Guest

    OK Doug, that gives me an idea of what I've got to do. VB is out of the question, as I'm very unversed in it. I'll give it a try in lisp, and see what happens. Thanks for the info.
     
    rewilson, Feb 17, 2004
    #11
  12. rewilson

    Jeff Mishler Guest

    OK Russ, now I'm confused......
    You originally said you wanted to unload RD4 if no images are found because
    an inadvertant use of a command would load RD4, using up a license. Now if
    the license isn't used until that command is entered, it seems to me that it
    is loading RD4. Why would you need to restart Acad if you unload it when it
    loads itself from the command issuance?
    As for the reactors, I see that Doug got you started in that direction. If I
    have some time this week I'll see what I can learn/do with them, too.

    I make the drive every 10-15 days. I live near Eugene, Oregon and work in
    the Bay area of California. When in Calif. I will work everyday I'm there so
    I can get back home sooner, and when I'm here(home) I will work when I feel
    like it...usually 3-6 hours a day. I'm on a salary and as long as I get the
    work out, noone complains about my schedule....except my wife when I'm
    gone.....

    Jeff

    code, too. I still want to investigate the other method (with the timer)
    though, because I think it would be more functional from a user standpoint.
    If I do it this way, and a user opens a vector drawing initially, the RD4 is
    gone. Then if he has to open a hybrid drawing to get some piece of info off
    of it, he will have to restart AutoCad. This will work for the intitial
    software push, but let's talk more about the timer option. By the
    way............glad you made it safely. Do you make that drive weekly?
     
    Jeff Mishler, Feb 17, 2004
    #12
  13. rewilson

    rewilson Guest

    Yes.............I know that's what I said. But the people in the BIG OFFICES (you know, the ones that always know what needs to be done, but have no clue how to do it) seem to think that it should be on a timer. I told them I'd look into it, so I feel like I should. I can see some validity in their thinking, though. If John Q. User is smart enough, he can open a hybrid file in the morning. You have 2 shortcuts in the installation (in case you're not familiar with it), one autocad and one rasterdesign 4. The rasterdesign 4 invokes at startup, while the autocad shortcut invokes the license usage at the execution of a rasterdesign command. Thus the need for a timer in rasterdesign 4 (or so the other parties involved say) . Maybe we're trying to complicate this thing too much? Any way, they won't let the software go out to all the users until we can assure them that we've addressed every issue. Thanks again for the help.
    BTW..........with a 9 hour drive, I would've guessed you to be contractor like myself.
     
    rewilson, Feb 17, 2004
    #13
  14. rewilson

    Doug Broad Guest

    Before programming your own timer solution, better check
    to see if Autodesk has a timer option for your RasterDesign
    network license or if it is sophisticated enough to look at command
    execution. On another newsgroup, the network license for
    Autodesk itself can be set to a time out period.




    the ones that always know what needs to be done, but have no clue how to do it) seem to
    think that it should be on a timer. I told them I'd look into it, so I feel like I should.
    I can see some validity in their thinking, though. If John Q. User is smart enough, he can
    open a hybrid file in the morning. You have 2 shortcuts in the installation (in case
    you're not familiar with it), one
     
    Doug Broad, Feb 17, 2004
    #14
  15. rewilson

    rewilson Guest

    I'll look into it............thanks a bunch guys! You've been a big help.
     
    rewilson, Feb 17, 2004
    #15
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.