Login Page - Create Account

Support Board


Date/Time: Fri, 13 Jun 2025 07:41:23 +0000



Post From: Unable to reset line after sc.DeleteUserDrawnACSDrawing using s_UseTool Tool

[2022-11-09 09:08:59]
User92573 - Posts: 563
Partially solved.

I have the line repainting but it doesn't always get deleted? So, still not acting as expected and I'm a little confused.

Here is the tool "Horizontal Line" clear function.


if (sc.MenuEventID == Button_2)
{
  if (sc.PointerEventType == SC_ACS_BUTTON_ON)
  {
    
  s_UseTool ChartDrawing;
        
    // begin accepting mouse events

    sc.SetCustomStudyControlBarButtonEnable(Button_2, 1);
    
    sc.GetUserDrawnDrawingByLineNumber(0, r_LineNumber_Test_RefLine, ChartDrawing);
    sc.DeleteUserDrawnACSDrawing(sc.ChartNumber, r_LineNumber_Test_RefLine);

    r_LineNumber_Test_RefLine= 0; // I'm now resetting the PersVar but I don't see why?    

    sc.SetCustomStudyControlBarButtonEnable(Button_19, 0);      

  }
  
  else if (sc.PointerEventType == SC_ACS_BUTTON_OFF)
  {
    sc.SetCustomStudyControlBarButtonEnable(Button_2, 0);        
  }      

}

If I reset the line number to 0, so that Sierra generates a new unique number when Button_1 is used to draw
a new line again using the same price value:

Tool.BeginValue = Price_Level_1

Then I felt all should work as intended but that's not the case?

Do I even need to reset the “r_LineNumber_Test_RefLine= 0;  ” because I can't see why it would be necessary as either the new or old exist in the PersVar.

Obviously getting a little confused. Certainly, allowing Sierra to generate another unique number solves it 'sometimes' but it's inconsistent?

Any help appreciated.
Date Time Of Last Edit: 2022-11-09 10:36:28