Login Page - Create Account

Support Board


Date/Time: Thu, 06 Feb 2025 20:23:23 +0000



[Programming Help] - Modify Drawing Configuration With ACSIL

View Count: 1124

[2020-05-06 08:58:05]
User462086 - Posts: 196
I'm trying to change the configuration of vertical lines that were added manually using the following:



#include "sierrachart.h"

SCDLLName("Test_ChangeVerticalLineConfig")

SCSFExport scsf_Test_ChangeVerticalLineConfig(SCStudyInterfaceRef sc){
  
  SCInputRef Config = sc.Input[0];
  
  if (sc.SetDefaults){
  
    sc.GraphName = "Test_ChangeVerticalLineConfig";
    sc.GraphRegion = 0;
    sc.AutoLoop = 0;
    
    Config.Name = "Configuration To Use (1-8)";
    Config.SetInt(1);
    
    return;
  }
  
  s_UseTool drawing;
  
  int drawingIndex = 0;
  
  while (sc.GetUserDrawnChartDrawing(sc.ChartNumber, DRAWING_VERTICALLINE, drawing, drawingIndex)){
    
    drawingIndex++;
    
    if (drawing.Region == 0){
      
      drawing.UseToolConfigNum = Config.GetInt();
    }
  }
}



This locates the vertical lines but doesn't modify their configuration. Are manually added chart drawings read-only? Thanks
Date Time Of Last Edit: 2020-05-06 10:31:54
[2020-05-06 11:03:10]
User462086 - Posts: 196
Hi SC, isn't this a question about Sierra Chart's features and functionality? There's no request to provide programming help.
[2020-05-06 11:43:45]
JohnR - User831573 - Posts: 309
It looks like you forgot to call usetool at the end to 'set' the things you changed in the structure

See in the attached in the docs example
imageSample.png / V - Attached On 2020-05-06 11:43:15 UTC - Size: 83 KB - 308 views
[2020-05-06 12:06:14]
User462086 - Posts: 196
Can't believe I forgot that. There was a 'programming help' element to the question after all.

"drawing.UseToolConfigNum" returns the correct configuration number but the drawings still aren't being updated. Luckily a similar approach will update the drawings' color.

Thank you JohnR.
Date Time Of Last Edit: 2020-05-06 12:22:54

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

Login

Login Page - Create Account