Hello Team,
Is it possible to draw a line with set of points having certain z value over scene?
I tried but line
Thank you,
Girish
Yes, you can use a Tube symbol in Dynamic mode. Here is some code to get you on the right track:
GraphicsOverlay<SPAN class="operator token">*</SPAN> overlay <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">GraphicsOverlay</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> overlay<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">setRenderingMode</SPAN><SPAN class="punctuation token">(</SPAN>GraphicsRenderingMode<SPAN class="operator token">::</SPAN>Dynamic<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">auto</SPAN> sceneProps <SPAN class="operator token">=</SPAN> overlay<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">sceneProperties</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> sceneProps<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setSurfacePlacement</SPAN><SPAN class="punctuation token">(</SPAN>SurfacePlacement<SPAN class="operator token">::</SPAN>Absolute<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> overlay<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">setSceneProperties</SPAN><SPAN class="punctuation token">(</SPAN>sceneProps<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> m_sceneView<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">graphicsOverlays</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN>overlay<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> PolylineBuilder<SPAN class="operator token">*</SPAN> pb <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">PolylineBuilder</SPAN><SPAN class="punctuation token">(</SPAN>SpatialReference<SPAN class="operator token">::</SPAN><SPAN class="token function">wgs84</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pb<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">addPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pb<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">addPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">20000</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pb<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">addPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">1.5</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">1.5</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">10000</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> pb<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">addPoint</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">1.75</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">1.75</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> SolidStrokeSymbolLayer<SPAN class="operator token">*</SPAN> strokeSymbolLayer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">SolidStrokeSymbolLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="number token">5000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="token function">QColor</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"red"</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> StrokeSymbolLayerLineStyle3D<SPAN class="operator token">::</SPAN>Tube<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MultilayerPolylineSymbol<SPAN class="operator token">*</SPAN> tubeSymbol <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">MultilayerPolylineSymbol</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>strokeSymbolLayer<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Graphic<SPAN class="operator token">*</SPAN> graphic <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token function">Graphic</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> graphic<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">setGeometry</SPAN><SPAN class="punctuation token">(</SPAN>pb<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">toGeometry</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> graphic<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">setSymbol</SPAN><SPAN class="punctuation token">(</SPAN>tubeSymbol<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> overlay<SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">graphics</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN><SPAN class="token function">append</SPAN><SPAN class="punctuation token">(</SPAN>graphic<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>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.