Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 09:14:24 +0000



Post From: [Programming Help] - ACSIL: sc.DeleteUserDrawnACSDrawing() does not delete all drawings

[2023-03-09 16:03:13]
User907967 - Posts: 53
Dear support team, I wrote a function that should delete all user drawings from the chart. I am calling this function when the user hides the study and also when the user removes the study. In the case of the former, all drawings are successfully removed from the chart. In the latter's case, a few user drawings always remain on the chart.

The function that removes all drawings:

    
s_UseTool Tool;

    Tool.Clear();

    int DrawingIndex = 0;

    while (sc.GetUserDrawnChartDrawing(sc.ChartNumber, DRAWING_RECTANGLE_EXT_HIGHLIGHT, Tool, DrawingIndex)){
      sc.DeleteUserDrawnACSDrawing(sc.ChartNumber, Tool.LineNumber);
      DrawingIndex++;
    }


The events where I am calling the above function:
  if (sc.LastCallToFunction)
  if (sc.HideStudy)

Why is the above while-loop not sufficient when using sc.DeleteUserDrawnACSDrawing, to get rid of all shapes?