I will have the need in the near future to render a path through 3d space and would like to represent the aircraft flying this path in the correct position and orientation. What's the best way to do this using the ArcGIS Pro SDK? Thanks!
Thank you. I will give it a try this week and let you know if I have any questions or problems.
Hi
I am assuming that your flight data will have its current position and orientation as attributes. If so, you can use "Attribute Driven symbology". The data has to be Z enabled 3D data. This will allow you to use Pro's Symbology Rotation attributes. You will also then have the capability to access the "Vary symbology by attributes" property page to drive your flight path using your data's fields.
Using the Pro SDK, here is a snippet that will accomplish this:
<SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">override</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">OnClick</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> lyr <SPAN class="operator token">=</SPAN> MapView<SPAN class="punctuation token">.</SPAN>Active<SPAN class="punctuation token">.</SPAN>Map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> QueuedTask<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Run</SPAN><SPAN class="punctuation token">(</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">var</SPAN> renderer <SPAN class="operator token">=</SPAN> lyr<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetRenderer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> CIMSimpleRenderer<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cimExpressionInfoX <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMExpressionInfo</SPAN> <SPAN class="punctuation token">{</SPAN> Expression <SPAN class="operator token">=</SPAN> <SPAN class="string token">"$feature.X"</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cimVisualVariableInfoX <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMVisualVariableInfo</SPAN> <SPAN class="punctuation token">{</SPAN> VisualVariableInfoType <SPAN class="operator token">=</SPAN> VisualVariableInfoType<SPAN class="punctuation token">.</SPAN>Expression<SPAN class="punctuation token">,</SPAN> ValueExpressionInfo <SPAN class="operator token">=</SPAN> cimExpressionInfoX <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cimExpressionInfoY <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMExpressionInfo</SPAN> <SPAN class="punctuation token">{</SPAN> Expression <SPAN class="operator token">=</SPAN> <SPAN class="string token">"$feature.Y"</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cimVisualVariableInfoY <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMVisualVariableInfo</SPAN> <SPAN class="punctuation token">{</SPAN> VisualVariableInfoType <SPAN class="operator token">=</SPAN> VisualVariableInfoType<SPAN class="punctuation token">.</SPAN>Expression<SPAN class="punctuation token">,</SPAN> ValueExpressionInfo <SPAN class="operator token">=</SPAN> cimExpressionInfoY <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> cimVisualVariableInfoZ <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMVisualVariableInfo</SPAN> <SPAN class="punctuation token">{</SPAN> VisualVariableInfoType <SPAN class="operator token">=</SPAN> VisualVariableInfoType<SPAN class="punctuation token">.</SPAN>None <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> listCIMVisualVariables <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">List</SPAN><SPAN class="operator token"><</SPAN>CIMVisualVariable<SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMRotationVisualVariable</SPAN> <SPAN class="punctuation token">{</SPAN> VisualVariableInfoX <SPAN class="operator token">=</SPAN> cimVisualVariableInfoX<SPAN class="punctuation token">,</SPAN> VisualVariableInfoY <SPAN class="operator token">=</SPAN> cimVisualVariableInfoY<SPAN class="punctuation token">,</SPAN> VisualVariableInfoZ <SPAN class="operator token">=</SPAN> cimVisualVariableInfoZ <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> renderer<SPAN class="punctuation token">.</SPAN>VisualVariables <SPAN class="operator token">=</SPAN> listCIMVisualVariables<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToArray</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> lyr<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetRenderer</SPAN><SPAN class="punctuation token">(</SPAN>renderer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks
Uma
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.