• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA HeightScript for XML rectangles

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
Wonder of wonders...that im actually doing something with XML. Then again this is sort of why I detest it.....

Has anyone gotten the HeightScript to work for Rectangles in the FSX XML schema?
 
Not sure if this is what script your looking for but here is what i think your asking for. Just a standard rectangle script!

<Element id="Brown static">
<FloatPosition>0.000,0.000</FloatPosition>
<Visibility>
(A:Attitude indicator pitch degrees:2, degrees) 0 &gt;
</Visibility>
<Rectangle id="Rectangle">
<Bright>True</Bright>
<Width>798</Width>
<Height>590</Height>
<FillColor>0x0A3554</FillColor>
</Rectangle>
</Element>
 
Found the problem. Rectangles have an extra option in the form of a <HeightScript> entry for dynamic size. The catch is you have to set the value of Height to the max size you want it to reach. Also in my case, my C++ gauge had swapped the rectangle rotation value for the height value so it was static mostly.
 
A quick search at AVSIM* yields these two solutions. One for FS9 Schema, the other for FSX Schema:

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

FSX Schema
Code:
<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>

* http://forum.avsim.net/topic/359962-how-draw-variable-length-line/
This question also gave me the incentive to re-edit the posts to restore/recover the XML scripts.
 
Back
Top