Is it possible to save an editing template to use in other projects? I do not see a way to do it. We have created some 'Group Templates' (which take some time to create), and seems to make sense to be able to save them and use them in other projects when needed. Kind of like a .lyrx file, but for Templates.
Am I missing something, or can this just not be done.
Solved! Go to Solution.
Awesome! Thanks Sean Jones and Scott Harris. One other thing I'm trying to figure out is how to load a layer file based on the layername, using .NET and/or Python code. So far my attempts at using the ApplySymbologyFromLayer_management geoprocessing tool have not worked. I'm pretty sure I have the syntax right, but it just won't work. There are a few posts on here about it, but no real concrete answer as to what might be causing the problem.
Can you help?? See these posts for reference:
Basically I'm trying to create a tool that will load the layer files automatically, just to make things easier for the users.
The issue you are seeing could be related to a bug report we have in Support, but I can't really say for sure. You may want to call us at 888-377-4575 to confirm. Here is there bug report I found:
BUG-000106281 The Apply Symbology From Layer tool does not apply symbology properly when it is executed through the ArcGIS Pro SDK.
FYI - This issue is reported to be fixed in 2.3 (the next release of ArcGIS Pro hopefully coming early next year - 2019).
Thanks Scott. I searched the 'Bugs' on the support site previously, but I guess I just didn't use the right keyword search. I see two bugs reported there, one for .NET and one Phython, so hopefully at v2.3 things will start to work for me.
Thanks for the information!
I wanted to provide some clarification here, as I see you are working with Group Templates and not just standalone Feature Templates. There are some limitations when sharing Group Templates through layer files and layer packages. For example, if you save a layer file that contains a Group Template when you add the layer file to a new Project it may be missing the references to other layers that are used in the builder. These references will have to be repaired manually in the Group Template properties, or if you want to make sure the template will function in another Project, you can use map files to share them. Save a map file—ArcGIS Pro | ArcGIS Desktop
These limitations are planned to be addressed in a future release of ArcGIS Pro.
So I am back into working with 'Group Templates' and was hoping you could answer a few questions. Here are the templates I am working with in my 'Water Service' feature class:
1. Originally I had more 3 templates here. After I renamed Fireline, ICI Water Service, and Res. Water Service (to include the ###mm diameter) and closed/opened ArcGIS Pro, I lost the 3 other templates that were associated to each of the mentioned ones. Should that have happened?
2. If I create a Layer File of Water Service, with templates, the templates are not showing up when I add the layer file to a new project. Group Template, or not group template, it doesn't seem to matter. All I see are the 'default' templates, not the ones that the layer had when I created the .lyrx file. Do you know if this is something being addressed since we originally discussed this in 2018?? After adding the layer file to a new map, this is what I get (even with/without the other layers required for the group templates).
Ok.....so I did some more testing and I need to revise what I said. If I 'drag and drop' the .lyrx file into ArcGIS Pro, then 'Yes', I do see the templates listed.
The Group Templates are blank regardless of whether the other related features are or are not in the map at the time of drag and drop. Do you know if this issue is something being looked at?
What I originally did was use my .NET code for reading a .lyrx file and updating the symbology. So I guess what I need to figure out now is how to extract the template information out of the .lyrx file. Bringing the symbology in seems to be working using something like this:
featureLayer?.SetRenderer(((CIMFeatureLayer)cimLyrDoc.LayerDefinitions).Renderer as CIMUniqueValueRenderer);
But I will now have to extract template information too. Any advice??
I'm trying to follow... are you saying you have a layer file (or layer package) that was created from a subset of the layers that are required for your group template, and then you add that layer file to a map that contains the remaining set of layers and are expecting the group template to still function?
If that's the case, I wouldn't expect it to work. What should work is if you create a layer file (or layer package) from a Group Layer and that and group contains all the layers required for your template to function:
Regarding renaming layers and losing group layer functionality (after closing and reopening Pro) - I just tested it and could not* (*edit) reproduce that. Perhaps there is a specific detail that I'm missing?