Jump to content

Sign in to follow this  
Bert Pieke

How draw variable length line?

Recommended Posts

I'm trying to draw a course line on a glass MFD gauge, knowingdesired track and distance to waypoint.I've got a fixed length line that shows the correct direction...How do I go about changing the "height" to a calculated variable,lets say a macro value?Would really appreciate some help with this! :(

					  <Element id="GPS track to waypoint">						    <FloatPosition>241.000,405.000</FloatPosition>					    <Visibility>@GPSWP</Visibility> 						    <Rectangle id="Rectangle">							    <LineWidth>1</LineWidth>							    <Bright>True</Bright>							    <Width>4</Width>							    <Height>120</Height>							    <LineColor>black</LineColor>							    <FillColor>magenta</FillColor>						    </Rectangle>							   <Rotation id="Rotation">							    <Expression id="Expression">								    <Script> @GPSROT 3.1416 + </Script>							    </Expression>							   						    </Rotation> 					    </Element>

Share this post


Link to post
Share on other sites

Answering my own question... there is a HeightScript identifier which appears to work... so I hope I'm OK,but if there is a better way, please let me know!

Edited by Bert Pieke

Share this post


Link to post
Share on other sites

..and just in case anyone is trying to duplicate this, be aware that you can shortenthe rectangle by using the HeightScript identifier, but NOT lengthen it..

Share this post


Link to post
Share on other sites

I assume that you tried this and it didn't work?

<Height>@Height</Height>

Share this post


Link to post
Share on other sites

Hi,

<Element>
  <Position X="540" Y="480"/>
  <Rectangle Width="2" Height="1600" Bright="Yes" Color="red">
    <HeightCode>(L:segment0,nmiles) 5 * </HeightCode>
  </Rectangle>
</Element>

Gives satisfactory results for me.

Edited by n4gix

Share this post


Link to post
Share on other sites

Jan that works brilliantly for the FS9 XML schema. I wonder what the FSX XML schema equivalent would be?

Share this post


Link to post
Share on other sites

This is what ended up working:

<Rectangle id="Rectangle">
  <LineWidth>1</LineWidth>
  <Bright>True</Bright>
  <Width>4</Width>
  <Height>400</Height>
  <HeightScript> ....calculations here </HeightScript>
  <LineColor>black</LineColor>
  <FillColor>magenta</FillColor>
</Rectangle>

Maximum length is 400 and when the calculations produce a number less than 400, the line is shortened.

Edited by n4gix

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...