Login Page - Create Account

Support Board


Date/Time: Tue, 06 May 2025 04:01:17 +0000



ACSIL: Updating / resetting a tools BeginIndex and EndIndex

View Count: 224

[2024-12-21 13:49:17]
User92573 - Posts: 560
Dear Support

Please can you offer some guidance on the following?

I have and existing drawing:

// Snippet.

if(r_LineNumber_Horizontal_Tool != 0)
Tool.LineNumber = r_LineNumber_Horizontal_Tool;

Tool.DrawingType = DRAWING_HORIZONTAL_LINE_NON_EXTENDED;
Tool.BeginIndex = TOOL_INDEX_POINT_1;
Tool.EndIndex = TOOL_INDEX_POINT_1 + 10; // initial index location

r_LineNumber_Horizontal_Tool = Tool.LineNumber; // Remember line number which has been automatically set.




I'd like to reset it using an index value held in TOOL_INDEX_POINT_2.

The following code runs on an event.

  if(r_LineNumber_Horizontal_Tool != 0)  
  {  
    s_UseTool Change_Line_EndIndex;
  
      sc.GetUserDrawnDrawingByLineNumber(0, r_LineNumber_Horizontal_Tool, Change_Line_EndIndex);      
      Change_Line_EndIndex.EndIndex = TOOL_INDEX_POINT_2;

    sc.UseTool(Change_Line_EndIndex);

    
    // The following confirms all values are correct an in place.

    msg.Format("TOOL_INDEX_POINT_1 %i, TOOL_INDEX_POINT_2 %i, r_LineNumber_Horizontal_Tool %i ",TOOL_INDEX_POINT_1,TOOL_INDEX_POINT_2,r_LineNumber_Horizontal_Tool);
    sc.AddMessageToLog(msg,1);

}

But there is no change in the lines length?

Any help appreciated as I'm a little lost.
[2024-12-21 22:10:21]
Sierra_Chart Engineering - Posts: 19419
From documentation:
When using BeginIndex to modify a drawing, whether user drawn or an Advanced Custom Study added drawing, make sure to clear s_UseTool::BeginDateTime by calling the Clear() function on that SCDateTime variable, in case it has a set Date-Time value. Example: UseTool.BeginDateTime.Clear().

Refer to:
Using Drawing Tools From an Advanced Custom Study: s_UseTool::BeginIndex

The same also applies to EndIndex.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2024-12-21 22:11:09
[2025-01-13 12:46:18]
User92573 - Posts: 560
Sorry I forgot to reply.

Thank you I had misread and felt it was not required. All okay when added.

Many thanks!

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account