Setting initial model orientation

838
4
04-20-2020 01:55 PM
JackCurran
New Contributor III

Hi everyone,

I'm trying to get my head around how I can control the initial orientation of some pre-made house models when generating from shapes imported from a fGDB. Below you can one house model generated on multiple footprints. These footprints have identical dimensions but different orientations. The one circled in green shows the correct model appearance, the ones in green (which have the footprints at a different orientation) show the same model, but in the same orientation as the green model, which is then skewed to fit the footprint at a different orientation.

I am currently doing nothing clever in the above - I am simply importing a model based on the start rule of the footprint.

One option I have is to create two versions of this house model in two orientations, and call the correct orientation by checking the width and depth of the building footprint. However, I will be working with hundreds of house models in this project, and I don't want to have to duplicate that library unnecessarily!

The other option is to manually set the first edge of each footprint which, in-turn, forces the model to be inserted in the correct orientation. However, I will be working with hundreds of footprints, so this manual process is not ideal. Additionally, if I want to edit any of my attributes in the fGDB, I would have to repeat this manual process when re-importing the shapes - definitely not ideal!

So my question is - is there a CGA master out there who can suggest some wizardry to get around this issue?

Many thanks in advance,

Jack

0 Kudos
4 Replies
by Anonymous User
Not applicable

You probably just want:      alignScopeToGeometry(yUp,0,longest)    before the object import.   You might have to add a setPivot or rotateScope operation after that for a 90 degree change.

JackCurran
New Contributor III

Thanks Brian - that's some great advice! However, it only goes some way to solving the problem. In the scenario below, both footprints are at a different orientation. Using your suggestion solves the skewing issue, but I need to be able to point the houses in different directions (the model circled in green is in the correct orientation, but the one circled in red is back to front). I tried to see if I could use initialShape.origin, but both footprint orientations are the same, so I can't automatically differentiate there.

Any ideas? Its starting to look like manually setting the first edge might be my only option...

0 Kudos
by Anonymous User
Not applicable

You might draw in your streets next (even if just for temporary) and try under the "shapes" tab, "Compute First/Street Edges".   That might work on most of your shapes but the corner lots can be tricky.  But if that works, you might not need the alignScopeToGeometry(yUp,0,longest) .

0 Kudos
JackCurran
New Contributor III

Ultimately, what I have done is add a "rotation override" attribute in the fGDB. That way, if there are two scenarios that can't be corrected by alignScopeToGeometry(yUp,0,longest) and/or rotateScope, I can rely on the attribute for the second scenario. Problem solved without any manual editing in CE...I've just got to remember to set the override value when putting together the original attribute table in the fGDB!

Thanks again for your help.