SetDrawEnv group
proland
I have a panel in which the user can set a start and end point for a fitting routine (Igor 6.30). I want to draw lines on the graph to mark these locations to make it easier on the user. However, my code only draws one of the two lines (which ever is listed first).
setdrawenv/w=$graphname linefgc=(0,0,65535) //blue line to mark end
controlinfo/w=set_variables Var2
drawline v_value,0,v_value,1
setdrawenv/w=$graphname linefgc=(0,0,0) //black line to mark start
controlinfo/w=set_variables Var1
drawline v_value,0,v_value,1
controlinfo/w=set_variables Var2
drawline v_value,0,v_value,1
setdrawenv/w=$graphname linefgc=(0,0,0) //black line to mark start
controlinfo/w=set_variables Var1
drawline v_value,0,v_value,1
If I use the same commands in the command window (replacing the variables with constants and specifying the graph name) both lines are drawn. I can't see why it works in the command window but not in my function. I made these to lines part of a group and got the recreation commands using DrawAction. The recreation command includes the code for both lines but only draws one.
Thanks for the help.
February 6, 2013 at 08:36 am - Permalink
I just tried this and it didn't work. Additionally, if the issue were with which window is on top, i would expect it to draw neither line, but it draws one. I also tried using DoWindow/F to bring the graph to the front prior to drawing. This also failed to resolve the issue.
Any other thoughts?
February 6, 2013 at 09:08 am - Permalink
I agree, that was my thought at the time, but not having the full picture of your code it seemed worth a shot.
Are there any other draw environment statements that precede the first in your example code? I believe that unless you use the "save" keyword, an environment setting will only apply to the next draw command. Maybe you set the x & y coordinates to relative or absolute? This begins to make sense with respect to your comment that the first draw command is executed as expected.
Hope this thought is more beneficial than my first.
February 6, 2013 at 11:25 am - Permalink
That was it... I was setting ycoord to prel and xcoord to the bottom axis. I copied this command and pasted it prior to the second drawing command it now both lines appear.
Thanks alot.
February 6, 2013 at 12:17 pm - Permalink