Message 1 of 1
Show/Hide Grid Bubbles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everybody
Recently, I'm creating an External Command to Hide or Show Grid Bubble.
Here is my simple Code ,when the command had completed , not things change in the active view but when I select a certain grid the check box has checked - the bubble not show.
#region Namespaces using System; using System.Collections.Generic; using System.Diagnostics; using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using System.Linq; #endregion namespace HoangHien { [Transaction(TransactionMode.Manual)] public class Template : IExternalCommand { public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiapp = commandData.Application; UIDocument uidoc = uiapp.ActiveUIDocument; Application app = uiapp.Application; Document doc = uidoc.Document; // Access current selection Selection sel = uidoc.Selection; var g = doc.GetElement(sel.GetElementIds().First()) as Grid; using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); g.ShowBubbleInView(DatumEnds.End0, doc.ActiveView); //uidoc.RefreshActiveView();. tx.Commit(); } doc.Regenerate(); uidoc.RefreshActiveView(); return Result.Succeeded; } } }
Thank you for your help!