Simulating a True Left Mouse Click on the Last entity created

Discussion in 'AutoCAD' started by matt_1ca, Feb 19, 2005.

  1. matt_1ca

    matt_1ca Guest

    Does anyone know how I can simulate a true mouse click on the last entity created? I mean a real mouse click so that the grips of the line that is selected is actually activated by the simulated mouse click made through pure code.

    I am trying to link AutoCAD with another application that seems at the problem point to be completely unrelated to AutoCAD. And the only thing standing between me and successfully integrating the two is literally a mouse click.

    The other application will ask the user near the end of its execution to click an entity. And whatever entity user clicks becomes the basis of the application's database retrieval.

    As long as the user is doing it manually the application works like magic. But the moment user tries to click select entity using (entsel) or any acadselectionset method from vba then the other application behaves as if nothing was selected.

    I can feel a way how it can be done but it is really not very easy and I am also not 100% sure if it will work at all --

    Please help me on this one -- I will forever be grateful for all the kind help you can give.

    Gratefully,
    Matt
     
    matt_1ca, Feb 19, 2005
    #1
  2. matt_1ca

    matt_1ca Guest

    Cheers,

    Lets dance!

    Everyone don't worry -- consider this question closed -- I figured out the solution --- yoooooohoooooooo!!!!!!!!!!!

    Matt
     
    matt_1ca, Feb 19, 2005
    #2
  3. matt_1ca

    Anne Brown Guest

    Good for you! but would you share your solution for others who
    may look at you question in the future?
     
    Anne Brown, Feb 19, 2005
    #3
  4. matt_1ca

    matt_1ca Guest

    Calculate exact position of the mouse, grab operating system to
    obtain system metric properties to get screen dimensions
    and use proportioning to get exact pixels needed to get mouse
    to destination point.

    Adjust mouse current location to destination location.
    Trigger mouse event with 2 adjacent calls using as arguments
    MOUSEEVENTF_LEFTDOWN thence MOUSEEVENTF_LEFTUP.

    Matt
     
    matt_1ca, Feb 19, 2005
    #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.