Support Board
Date/Time: Mon, 25 Nov 2024 10:46:34 +0000
[Programming Help] - ACSIL UseTool - How to toggle Text on a line to its endpoint
View Count: 202
[2024-03-06 23:10:49] |
User43 - Posts: 101 |
[Repost since in my original post the Title did not come through as expected] Hello, Can anyone please advise on how to toggle "Draw Text At End" for a drawn line via ACSIL. see attached pic for reference. Looking through the tools structure I found ShowLabelsAtEnd
but that setting is not documented and did not work as expected.here my test code so far: SCSFExport scsf_UseToolExampleLine(SCStudyInterfaceRef sc) {
// Set configuration variables SCInputRef Input_Pos = sc.Input[0]; SCInputRef Input_UserDwg = sc.Input[1]; if (sc.SetDefaults){ sc.GraphName = "UseTool Example: Line"; sc.GraphRegion = 0; sc.FreeDLL = 0; sc.AutoLoop = 0; // No automatic looping Input_Pos.Name = "Position"; Input_Pos.SetInt(-1); Input_UserDwg.Name = "User drawing"; Input_UserDwg.SetInt(-1); return; } int &LineNumber = sc.GetPersistentInt(1); if (sc.IsFullRecalculation) { // Draw vertical line on prior bar during full recalculation. s_UseTool Tool; Tool.Clear(); Tool.ChartNumber = sc.ChartNumber; // Tool.LineNumber will be automatically set. No need to set this. Tool.DrawingType = DRAWING_LINE; Tool.AddAsUserDrawnDrawing = Input_UserDwg.GetInt(); int DrawingIndex = sc.ArraySize - 4; Tool.BeginDateTime = sc.BaseDateTimeIn[DrawingIndex - 10]; Tool.EndDateTime = sc.BaseDateTimeIn[DrawingIndex]; Tool.BeginValue = sc.Low[DrawingIndex - 10]; Tool.EndValue = sc.High[DrawingIndex]; Tool.Text = "Label 1"; Tool.TextAlignment = DT_BOTTOM | DT_LEFT; Tool.ShowLabelsAtEnd = Input_Pos.GetInt(); Tool.VerticalText = 1; Tool.Region = 0; Tool.Color = RGB(255, 255, 0); Tool.LineWidth = 5; Tool.AddMethod = UTAM_ADD_ALWAYS; sc.UseTool(Tool); LineNumber = Tool.LineNumber; } } Thanks |
SierraChart_64_OX7MA8woJz.png / V - Attached On 2024-03-06 23:09:26 UTC - Size: 15.52 KB - 57 views |
To post a message in this thread, you need to log in with your Sierra Chart account: