Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How draw variable length line?

Featured Replies

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

  • Author

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

  • Author

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

  • Moderator

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

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

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Moderator

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
  • Author

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

  • 3 years later...
  • Moderator

(* bump to top *)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.