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>


Bert

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

Bert

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..


Bert

Share this post


Link to post
Share on other sites

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

<Height>@Height</Height>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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?


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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

Bert

Share this post


Link to post
Share on other sites

(* bump to top *)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...