<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hide annotation in a dependent view in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12946366#M3863</link>
    <description>&lt;P&gt;I try to override by element directly in the view (no matter is a &lt;SPAN&gt;dependent view or not&lt;/SPAN&gt;), and it works.&lt;/P&gt;&lt;P&gt;Get the&amp;nbsp;OverrideGraphicSettings, edit it, and put back.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;UIDocument uiDoc = commandData.Application.ActiveUIDocument;
Autodesk.Revit.DB.View activeView = uiDoc.ActiveView;
ElementId testElementId_1 = new ElementId(204563);
ElementId testElementId_2 = new ElementId(204565);

OverrideGraphicSettings oP = activeView.GetElementOverrides(testElementId_1);
MessageBox.Show(oP.ProjectionLineColor.Red.ToString() + " "+
    oP.ProjectionLineColor.Green.ToString() + " "+
    oP.ProjectionLineColor.Blue.ToString()
    );
Transaction transaction = new Transaction(uiDoc.Document);
transaction.Start("CHG color");


OverrideGraphicSettings oG = activeView.GetElementOverrides(testElementId_2);
oG.SetProjectionLineColor(new Autodesk.Revit.DB.Color(0, 128, 0));
activeView.SetElementOverrides(testElementId_2, oG);
transaction.Commit();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2024 08:20:21 GMT</pubDate>
    <dc:creator>admaecc211151</dc:creator>
    <dc:date>2024-08-08T08:20:21Z</dc:date>
    <item>
      <title>Hide annotation in a dependent view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12934311#M3859</link>
      <description>&lt;P&gt;Has anyone attempted to hide annotation in a dependent view?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a NoPlot function for Revit. Basically, any dimensions, text or lines with NPLT in the name will be hidden in the view. This works perfectly, in the main view. However, in the dependent views the annotation remains visible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my searching I have found out how to determine if the view is dependent, I have found the Id of the dependent view, but I can not figure out how to extract the dependent view Id to set that as the active view.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 20:39:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12934311#M3859</guid>
      <dc:creator>TomHEV9PF</dc:creator>
      <dc:date>2024-08-01T20:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hide annotation in a dependent view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12934744#M3860</link>
      <description>&lt;LI-CODE lang="csharp"&gt;theView.getPrimaryViewId();&lt;/LI-CODE&gt;&lt;P&gt;If your trying to use visibility settings and filters, get its parent view and edit it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/determining-if-element-is-in-dependent-view/m-p/9241673#M43746" target="_blank"&gt;https://forums.autodesk.com/t5/revit-api-forum/determining-if-element-is-in-dependent-view/m-p/9241673#M43746&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 03:07:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12934744#M3860</guid>
      <dc:creator>admaecc211151</dc:creator>
      <dc:date>2024-08-02T03:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Hide annotation in a dependent view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12935905#M3861</link>
      <description>&lt;P&gt;Thanks for the replies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot use visibility settings or filters because they do not work on annotation. The closest I have come is to turn the color to something like 244,255,255.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I said, my problem is that the annotation does turn off in the primary view, not the dependent views. It's the dependent views where I'm trying to turn off the annotation. I can find the Ids of the primary view and the dependent views but I haven't found a way to use the Id of the dependent view to hide the elements.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 15:32:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12935905#M3861</guid>
      <dc:creator>TomHEV9PF</dc:creator>
      <dc:date>2024-08-02T15:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hide annotation in a dependent view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12943030#M3862</link>
      <description>&lt;P&gt;it should just be View.Id (where view is the dependent view). And feed that to&amp;nbsp; something like this to make it active:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public Result Execute(ExternalCommandData commdata, ref string msg, ElementSet elemset)
{
    _uidoc = commdata.Application.ActiveUIDocument;
    _uidoc.ActiveView = View.Id;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 06 Aug 2024 22:07:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12943030#M3862</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2024-08-06T22:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hide annotation in a dependent view</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12946366#M3863</link>
      <description>&lt;P&gt;I try to override by element directly in the view (no matter is a &lt;SPAN&gt;dependent view or not&lt;/SPAN&gt;), and it works.&lt;/P&gt;&lt;P&gt;Get the&amp;nbsp;OverrideGraphicSettings, edit it, and put back.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;UIDocument uiDoc = commandData.Application.ActiveUIDocument;
Autodesk.Revit.DB.View activeView = uiDoc.ActiveView;
ElementId testElementId_1 = new ElementId(204563);
ElementId testElementId_2 = new ElementId(204565);

OverrideGraphicSettings oP = activeView.GetElementOverrides(testElementId_1);
MessageBox.Show(oP.ProjectionLineColor.Red.ToString() + " "+
    oP.ProjectionLineColor.Green.ToString() + " "+
    oP.ProjectionLineColor.Blue.ToString()
    );
Transaction transaction = new Transaction(uiDoc.Document);
transaction.Start("CHG color");


OverrideGraphicSettings oG = activeView.GetElementOverrides(testElementId_2);
oG.SetProjectionLineColor(new Autodesk.Revit.DB.Color(0, 128, 0));
activeView.SetElementOverrides(testElementId_2, oG);
transaction.Commit();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 08:20:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/hide-annotation-in-a-dependent-view/m-p/12946366#M3863</guid>
      <dc:creator>admaecc211151</dc:creator>
      <dc:date>2024-08-08T08:20:21Z</dc:date>
    </item>
  </channel>
</rss>

