File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
All Forums
Origin Forum for Programming
Forum for Origin C
Accessing axis tree
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
Forum for Origin C
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): 2022 Operating System:win 10 Hi, I'm facing a weird issue when trying to access axis tree. [code]void add_special_tick(double dTick, string strTick) { GraphLayer gl = Project.ActiveLayer(); if (gl) { Axis axesX = gl.XAxis; Scale scX(gl.X); Tree tr; tr = axesX.GetFormat(FPB_ALL, FOB_ALL, true, true); tr.Root.NewAxes.NewAxis2.Specials.SpecialCount.nVal = 1; tr.Root.NewAxes.NewAxis2.Specials.Specials.Special1.Type.nVal = 35; tr.Root.NewAxes.NewAxis2.Specials.Specials.Special1.Value.dVal = dTick; tr.Root.NewAxes.NewAxis2.Specials.Specials.Special1.EnableLabel.nVal = 1; tr.Root.NewAxes.NewAxis2.Specials.Specials.Special1.Label.strVal = strTick; double dX1 = scX.From; double dX2 = scX.To; double dTol = (dX2 - dX1) / 20; TreeNodeCollection tnc(tr.Root.NewAxes.NewAxis2.RefLines.RefLines, "RefLine"); foreach (TreeNode tn in tnc) { if (dTick + dTol > tn.Value.dVal && dTick - dTol < tn.Value.dVal) tn.Labels.Label1.Show.nVal = 0; } if (0 == axesX.UpdateThemeIDs(tr.Root)) { bool bRet = axesX.ApplyFormat(tr, true, true); } } }[/code] 1st Issue: If I want to get axis from and to, I need to use Scale object If I try to read tr.Root.Scale.From.dVal or tr.Root.Scale.To.dVal, I get an error saying that those variables are not declared. Why that ? When debugging, I can see that they exist Moreover, it's a treenode, so compiler shouldn't care whether that leaf exists or not 2nd issue: The function will add a special tick with label in a graph that has a few reflines with labels. If the special tick is near reflines labels, I will hide them Here again, I have an error saying that tn.Labels.Label1.Show.nVal is not declared Thanks for the help
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000