I have been working with a lot of CAD data, and have noticed that all of the CAD files I've ever worked with come in to Pro with "LyrOn = 1 And LyrFrzn <> 1" as an applied definition query. This query is applied to every sub-layer in the CAD (Point, Polyline, Polygon, and MultiPatch). I am finding it extremely tedious to turn off the queries for every sub-layer in every CAD file I bring in.
Does anyone know of a way to either:
1.) Change Pro's settings so that CAD files come in with no definition query, OR
2.) Turn off the definition queries for multiple CAD files at once?
does
CAD To Geodatabase (Conversion)—ArcGIS Pro | Documentation
do the same thing?
unless you have a need to keep the cad format within Pro
Hi Dan, great suggestion. I do use that function a lot so had noticed there were no definition queries applied once converted to a feature class. Unfortunately, yes, for my purposes seeing it in CAD would be preferable.
I am hoping that someone out there will be able to answer my question in a more direct sense. It's quite an annoying little problem but maybe has no solution. In the meantime I realized I could just script something out, and so this will get me by:
import arcpy
original_path = 'original_path'
new_path = 'new_path'
aprx = arcpy.mp.ArcGISProject(original_path)
map = aprx.listMaps()[0] # I only had the one map
lyr_list = map.listLayers()
for lyr in lyr_list:
# I only wanted to see all points and lines
if 'Polyline' in lyr.name or 'Point' in lyr.name:
lyr.definitionQuery = None
aprx.saveACopy(new_path)
@HBrowning
The alternative is to get the CAD team to not include data in a file if it shouldn't be used. 🙂
Or you can just wish for a dragon.
I am working with legacy drawings. I am also inclined to believe this is a setting in Pro because all of the various projects of different vintages and from different contractors all come in with this same definition query. I don't necessarily agree with what the mystery contractor from another time period thought should be hidden.
@HBrowning From experience I'd import the CAD data as supplied with the layers shown/enabled by the def query into your main work area. Then import the disabled layers separately into a scratch or access controlled area.
I have seem it too many times where tuned off layers have old designs, temporary guidelines or construction lines, and even the original site design at another project site from a previous client the contractor worked at.
If 'regular users' get hold of this data prior to it getting vetted and cleaned, or if it inadvertently shows up in a web map a project manager has access to, it can cause great confusion or other issues no-one has time to deal with.
The few minutes of extra work splitting the import makes life so much simpler.
That all said - if I know where the CAD data comes from and trust the source, having filters in place has no use.
Maybe lodge an Idea to make this a selectable setting in Options.
Do you have a suggested method for how to import only the disabled layers into ArcGIS Pro? Apart from using the script that I posted above?
Regarding the other advice - thank you - luckily in my case what you have described does not apply. This is a research project to figure out how to stand up a new data system and build new CAD data standards so that we actually receive files with standards and they can interop with ArcGIS. No one but myself and the CAD lead are working with these modified files. I don't think my question really relates to needing to describe more of my particular use case as it is very specific.
I will probably lodge an Idea as you mentioned - good suggestion, thanks!
@HBrowning Flip the definition queries around to only include the off & frozen layers. Manually for a handful or make a model to apply a new def query and import.
"so that we actually receive files with standards" = has to be in the contract and the data supply chain incl commercial & project managers have to be on board. Not just the 'we'll make sure' to keep the drafty happy, but giving you authority to raise a non-compliance if the data you receive is not to spec.
Also make sure IP clauses are in your favour. None of that 'we own it and give you a license' blah blah.