Is there a way to add a feature to the current MAP that is open in Pro, in a stand alone script?
I know the below code adds it to the first map.
But what if I want to add it to whatever map I have opened?
The other option is to create a new map in the CURRENT APRX and add the features there. It would be more user friendly if it could add it to the map that you are currently on.
aprx <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mp<SPAN class="punctuation token">.</SPAN>ArcGISProject<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"CURRENT"</SPAN><SPAN class="punctuation token">)</SPAN>
mp <SPAN class="operator token">=</SPAN> aprx<SPAN class="punctuation token">.</SPAN>listMaps<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
mp<SPAN class="punctuation token">.</SPAN>addDataFromPath<SPAN class="punctuation token">(</SPAN>fgdb <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\\"</SPAN> <SPAN class="operator token">+</SPAN> e <SPAN class="operator token">+</SPAN> <SPAN class="string token">"_buffer"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Regards,
Adam