Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programmatically copy and paste and invert a user drawn Ray or Extended Line

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Programmatically copy and paste and invert a user drawn Ray or Extended Line

    Hi,

    I want to "invert" a user drawn Ray or Extended Line. At the moment, I have to copy and paste the Ray/Extended Line and then swap the "Start Y" and "End Y" which is a hassle.
    My ambition is to create an add-on that will listen to a hotkey and then copy -> paste -> invert the Ray/Extended Line automatically. Can you provide some tips on how this can be done?

    Thanks!

    PS I know the hotkey part but it's accessing the copy and paste function that's difficult for me.

    #2
    Hello mav8rick,

    Thanks for the post.

    There would not be a way to programaitically copy/paste to invert the values but you could use code to re draw the object based on new values you had calculated. A script could be used to watch for the keyboard event to toggle and then locate the object and redraw it.



    I look forward to being of further assistance.

    Comment


      #3
      Thanks for your reply Jesse,

      The issue is that I need the mirrored line to be "draggable" so programmatically drawing the line would not cut it. Guess I have to figure a way to use an external program to drive a series of keystrokes or something. If you have any idea how I can achieve this - mirror the user drawn line as another user drawn line - just let me know.

      Comment


        #4
        Hello mav8rick,

        Outside of using the Draw. methods there is not necessarily a way to make a manually drawn line without just drawing it yourself. You can unlock the line after drawing it if you needed to later move it. You can find an example in the following forum post: https://ninjatrader.com/support/foru...05#post1077405

        I look forward to being of further assistance.

        Comment


          #5
          Thanks Jesse - I'll try that!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          344 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          557 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X