<?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: Looking for help with HideBubbleInView and ShowBubbleInView in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119187#M85600</link>
    <description>&lt;P&gt;Thanks for the help with that. Is there a coordinate to use that isn't dependent on the view angle?&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2026 15:26:23 GMT</pubDate>
    <dc:creator>jfranzR9VWK</dc:creator>
    <dc:date>2026-05-06T15:26:23Z</dc:date>
    <item>
      <title>Looking for help with HideBubbleInView and ShowBubbleInView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14118951#M85597</link>
      <description>&lt;P&gt;I have been attempting to convert something that I wrote in pyRevit into c# code that will hide all grid bubbles. Currently I have set it to hide all of them, but it will move them to a specific side in the future. The formatting might be a little different bit different because I'm using the Nice3point templates, but most of it should be the same. The code works fine in python. I suspect that I might be using show and hide wrong, but as far as I can tell this is how it's used in the samples.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public override void Execute()
    {
        Document doc = Application.ActiveUIDocument.Document;
        Result r = Result.Failed;
        Autodesk.Revit.DB.View view = doc.ActiveView;
        
        var grids = new FilteredElementCollector(doc, doc.ActiveView.Id).OfCategory(BuiltInCategory.OST_Grids).WhereElementIsNotElementType().ToList();
        
        Console.WriteLine(grids.Count + " grids in list");
        foreach (Element element in grids)
        {   
            //treat elements as grids
            Grid grid = element as Grid;
            Console.WriteLine(grid.Name);
            using (Transaction transaction = new Transaction(doc, "Fix bubbles"))
            {
                //get endpoints for grids
                XYZ start = grid.Curve.GetEndPoint(0);
                XYZ end = grid.Curve.GetEndPoint(1);
                transaction.Start();
                try
                {
                    //if horizontal
                    if (start.Y == end.Y)
                    {
                        Console.WriteLine("hit if horizontal");
                        grid.HideBubbleInView(DatumEnds.End1, view);
                        grid.HideBubbleInView(DatumEnds.End0, view);
                    }
                    //if vertical
                    else if (start.X == end.X)
                    {
                        Console.WriteLine("hit if vertical");
                        grid.HideBubbleInView(DatumEnds.End0, view);
                        grid.HideBubbleInView(DatumEnds.End1, view);
                    }
                }
                catch (Exception e)
                {
                    return;
                }
            }
            
        }
        
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 13:32:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14118951#M85597</guid>
      <dc:creator>jfranzR9VWK</dc:creator>
      <dc:date>2026-05-06T13:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with HideBubbleInView and ShowBubbleInView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119171#M85599</link>
      <description>&lt;P&gt;two things. First, possibly the actual issue, although i'm surprised Revit didn't yell at you for this when you tried to run it, but you don't appear to be committing your transaction. Second, as a reminder for your future endeavors, coordinate values are always internal coordinates, so detection of horizontal vs vertical needs to account for view rotation.&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 15:18:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119171#M85599</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2026-05-06T15:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with HideBubbleInView and ShowBubbleInView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119187#M85600</link>
      <description>&lt;P&gt;Thanks for the help with that. Is there a coordinate to use that isn't dependent on the view angle?&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2026 15:26:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119187#M85600</guid>
      <dc:creator>jfranzR9VWK</dc:creator>
      <dc:date>2026-05-06T15:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for help with HideBubbleInView and ShowBubbleInView</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119283#M85601</link>
      <description>&lt;P&gt;not really no. you have to account for it yourself. here's an example of how i deal with it:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;View _activeView = _uidoc.ActiveView;
BoundingBoxXYZ crop = _activeView.CropBox;
XYZ viewX = crop.Transform.BasisX;
//angle of the view from 0
double viewRot = HorizAngle(XYZ.Zero, viewX);
//angle of the object from 0, plus the view rotation
 double ang = HorizAngle(startpt, endpt)) + viewRot;
 if (ang &amp;gt; Math.PI / 2 &amp;amp;&amp;amp; ang &amp;lt;= 1.5 * Math.PI)
 {
	 //testing if angle is greater than 90 and less than or equal to 270
	 //adjust to your needs
 }

 public double HorizAngle(XYZ point1, XYZ point2)
 {
     //finds the angle from X axis, much better than Revit's angleto method, as it returns greater than 180 degrees.
     double testang = Math.Atan2(point2.Y - point1.Y, point2.X - point1.X);
     //normalize the angle to return 0 to 360 becuase atan2 returns -180 to 180
     testang = (testang % (Math.PI * 2) + (Math.PI * 2)) % (Math.PI * 2);
     return testang;
 }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 May 2026 16:27:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/looking-for-help-with-hidebubbleinview-and-showbubbleinview/m-p/14119283#M85601</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2026-05-06T16:27:48Z</dc:date>
    </item>
  </channel>
</rss>

