NOTE! THIS IS A DIRTY HACK!
Avoid if possible.
DO NOT use in the middle of another operation or observer event!
It creates a couple of temp groups and extract the axes information from that. This works because since SU7 groups orient themselves by the working axes.
If you absolutely need to use this within another operation then remove the start/abort_operation and manually remove the temp group.
Note that you only get the orientation of the axes - not the position because for some reason the transformation return bogus values for the origin.
<span class="syntaxdefault"><br /> </span><span class="syntaxcomment"># SU7+ only - incorrect in older versions.<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment"># A hack to get the current model axis.<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment">#<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment"># @return [Array<Vector3d,Vector3d,Vector3d>]<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment"># @since 1.1.0<br /></span><span class="syntaxdefault"> def get_local_transformation<br /> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">start_operation</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Get Local Transformation (Hack)'</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> entities </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br /> tr </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">transformation<br /> </span><span class="syntaxcomment"># (?) SketchUp bug?<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment"># The transformation returned has X, Y and Z set to 1.0e+030!<br /></span><span class="syntaxdefault"> </span><span class="syntaxcomment"># Why this high value? Overflow bug?<br /></span><span class="syntaxdefault"> Geom</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Transformation</span><span class="syntaxkeyword">.new(</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">xaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">yaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> tr</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">zaxis</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> ORIGIN </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> ensure<br /> </span><span class="syntaxkeyword">@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">abort_operation<br /> end<br /></span>