Hello Jeremy,
Thank you for your reply, sorry for the confusion in my original post. Allow me to clarify what I meant.
I have a host file that has a linked file attached to the host. Within this host file, I apply a color override to the linked file using the RVT Link Display settings. I select the Model Categories tab and apply the color override to the furniture category specifically. Within the Model Categories, there is an option to set the override using the Host View, Link View, or <custom>. I chose the <custom> option, so it does not come from the linked file views or from one of the existing host views. So what I am trying to do is detect when the <custom> is used on those specific objects from that linked file and send that color information to my own program. I have already sent the model information to my own program so I just need to apply the same colors to those same furniture objects.
I can already get the color overrides in both the host and linked file views using the following code:
{
Category categoryOfInterest = curDocument.Settings.Categories.get_Item(categoryOfInterestName);
OverrideGraphicSettings settings = targetView.GetCategoryOverrides(categoryOfInterest.Id);
}
where curDocument is one of the loaded Documents, and targetView is a View3D from that Document.
However, any color overrides in the <custom> settings are ignored. If the targetView is from the host file, GetCategoryOverrides returns the settings for the host file (not the <custom> settings). If the targetView is from the LinkedFile, it returns the settings for the linked file (still not the <custom> settings).
I've attached a sample Revit host file (colorOverrideTestFile_HOST.rvt) built from samples that come with Revit 2019. It has a linked file with a color override (colorOverrideTestFile_LINK1.rvt) that is also attached, and a link file without a color override (the rac basic file that comes with Revit) that is not attached. I've also included a sample plugin that I've been using for simple tests that is based on the sample plugin AllViews that is provided with the Revit 2019 SDK. The sample plugin has two approaches that it uses: the one given above that calls GetCategoryOverrides and one that tries to find the information in the material data of output by through the CustomExporter API (I have no idea if this second approach is relevant, which is why it's commented out in the sample plugin).
If you open colorOverrideTestFile_HOST.rvt, the furniture in the host file is colored blue due to the override, the furniture from colorOverrideTestFile_LINK1.rvt is red due to the override in that linked file, and the furniture in rac basic is green due to the <custom> settings. If you run the "All Views" external command from the sample plugin, it will find the blue and red overrides, but it will not find the green one. What I'm hoping for is that there is some bit of code that I can add to this sample plugin (and eventually, the actual plugin for our program that I'm working on) that will allow it to find the green color override.
I really appreciate your assistance with this issue. Our clients will be incredibly happy if we can get the <custom> working for them.
~ Scott