Author Topic: Inside AddIn Environment - Insert Object at Cursor Position  (Read 8533 times)

Luca Kittelmann

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Inside AddIn Environment - Insert Object at Cursor Position
« on: November 23, 2021, 09:27:04 am »
Hello everyone,

Inside a diagram, I would like to insert an element at the cursor position. Until now it gets generated at a default position, which is the middle of the diagram.

Is there a possibility to extract the position of the cursor and check if it is inside the diagram in order to generate the element there?
It is possible to get the cursor position with System.Windows.Point PointToScreen or System.Windows.Forms.Cursor.Position, but i assume that position is relative to the whole screen and not just the diagram.

Thanks in advance for the help,
Luca

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Inside AddIn Environment - Insert Object at Cursor Position
« Reply #1 on: November 23, 2021, 09:40:39 am »
Not really. I'd guess if your a Windoze guru you find ways to locate the cursor position in the current window. But as to where that would be relative in your diagram depends on the different zoom and scaling factors. You'll probably go nut upon decoding that all. If it's possible at all. I'd say: simply not feasible. Try sending a feature request to get the click position via some operation. Looks like a good one but you should not hold your breath.

q.