I'm stumped. The following documentation says activeView will return the active MapView or Layout. I've searched high and low trying to find code to use which will tell me If the "active view" is a map or a layout but am having zero luck.
Any insight appreciated.
Thanks!
MapView—ArcGIS Pro | Documentation
Just check the type of the object or class inheritance:
<SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> type<SPAN class="punctuation token">(</SPAN>aprx<SPAN class="punctuation token">.</SPAN>activeView<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token"><</SPAN><SPAN class="keyword token">class</SPAN> <SPAN class="string token">'arcpy._mp.Layout'</SPAN><SPAN class="operator token">></SPAN> <SPAN class="operator token">>></SPAN><SPAN class="operator token">></SPAN> isinstance<SPAN class="punctuation token">(</SPAN>aprx<SPAN class="punctuation token">.</SPAN>activeView<SPAN class="punctuation token">,</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>_mp<SPAN class="punctuation token">.</SPAN>Layout<SPAN class="punctuation token">)</SPAN> <SPAN class="token boolean">True</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
ah .map.name
I was trying just .name
Suppose it makes sense when you think about it though.
Are these properties documented anywhere? Then only documentation I could find about activeView is basicallly the page I linked in the original question.
view = aprx.activeView
name = view.map.name
Once I've got the activeView how do I grab the name of the MapView or Layout?
Just did, thanks. Had been away from my computer...
If my response answered your question, please mark it Correct to cloud out the question.
Thanks so much Joshua!
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.