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

HEADINGFROMNEARESTLINE angle

Messages
223
Country
us-ohio
Hi Arno

I'm still getting a slight angle offset when using this step but leaving on offset value of 0. The objects are somewhere between 5° and 20° angled from what I think is the nearest line (the one I'm trying to line them up against). I wonder what I'm doing wrong. Could it be anything to do with my selection of start position when initially placing the points along a line??

Welcome your thoughts!

ian
 
Hi Ian,

Would you be able to make a small test case with your data so that I can try it?

For my data it worked very well. But maybe I should double check at other latitudes to make sure that offset bug is not there.
 
Sure, no problem.
 
Just want to point out to any with similar question - but nobody could be as silly as me - that Arno suggested a solution to what I was doing wrong. Basically I created points along a line, attempted to change their heading to by nearest line (doh!), and they ended up at times selecting a different line and resetting their heading to that one.
All I needed to do was keep them as placed along the original line and not do anything with HEADINGFROMNEARESTLINE.

Trying to be too clever as usual.

Thanks for the answer, Arno.

Sent from my SAMSUNG-SGH-I717 using Tapatalk
 
And to add to that. I did also run a test to compare the heading calculated by both steps. In general they are the same. But in the configuration file used by Ian the points got an offset from the line as well. That resulted in another line sometimes being closer and therefore the heading was calculated differently.
 
Briefly resurrecting this thread to ask whether HEADINGFROMNEARESTLINE works for AGN houses? I've tried all manner of scripts but the houses ( Roofs Gabled ALL ) remain stubbornly orientated east-west.

I'm using a script that utilises the PlacePointsAlongLine command to then place houses along roads ( plenty of road GIS but no buildings for this area ). It works beautifully, but for the house orientations. Any ideas folks? The thread above seemed to solve it, but I fear it's referrring only to Library Objects, not AGN.

ETA: The original post refers to an offset value - there is no argument for that in the current HEADINGFROMNEARESTLINE - could that be what I'm missing somewhere?

Code:
ImportOGR|roads.shp|*|type|AUTODETECT
#
PlacePointsAlongLine|type="secondary"|SINGLE|12;16|12;12|0|String;house|house|HDG|INHERITPARENTATTR
#
PointToPolygon|house="house"|10;10|*|String;house|homes
#
HEADINGFROMNEARESTLINE|house="homes"|FTYPE="LINE" AND type="secondary"|HDG
#
SPLITGRID|AGN|*
#
CreateAGNGenBuild|house="homes"|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
#
SETAGNBUILDINGHEIGHT|*|1.0;0.0;0.0;0.0
#
ExportAGN|FSX|D:\DeanFSXScenery\Houses on a line
 
Last edited:
Solved it folks - the following line needed the "HDG" added in place of *;

Code:
PointToPolygon|house="house"|10;10|HDG|String;house|homes
 
if you have road data available you can use heading to point to one of the roads,
this will position the house front correctly facing a street, left without special heading i think it they always default to one direction,
 
Hi,

The roof direction if not determined from the heading attribute or so. It is taken from the order of the vertices in the polygon.

Not sure why you would need the step to add the heading from the lines, since the step that places the points already determined the heading.
 
Back
Top