#region Namespaces using Autodesk.Revit.ApplicationServices; using Autodesk.Revit.Attributes; using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.UI.Selection; using System; using System.Collections.Generic; using System.Diagnostics; #endregion namespace Prueba { [Transaction(TransactionMode.Manual)] public class Command : 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; var actiV = doc.ActiveView.Name; //View actiV = doc.ActiveView; string nomV = actiV.Name; // Access current selection Selection sel = uidoc.Selection; // Retrieve elements from database FilteredElementCollector col = new FilteredElementCollector(doc) .WhereElementIsNotElementType() .OfCategory(BuiltInCategory.INVALID) .OfClass(typeof(Wall)); // Filtered element collector is iterable foreach (Element e in col) { Debug.Print(e.Name); } // Modify document within a transaction using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); TaskDialog.Show("Command.cs", "FullPathName .addin: Prueba.Command" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); tx.Commit(); } return Result.Succeeded; } //fin Result Execute( //Inicio Comandos internos //Empresa -> EsquemaEstándar -> Rp1g2i1 : ComboBox internal static void Tit_rp1g2i1(UIApplication UIApp) { var uidoc = UIApp.ActiveUIDocument; var doc = uidoc.Document; var actiV = doc.ActiveView.Name; TaskDialog.Show("Command.cs - tarea2", "invocado: App.cs -> cb1_CurrentChanged(...) -> Command.Tit_rp1g2i1(e.Application)" + "\nproceso : internal static void Tit_rp1g2i1(UIApplication UIApp)" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); return; } //Empresa -> EsquemaEstándar -> Rp1g2i2 : ComboBox internal static void Tit_rp1g2i2(UIApplication UIApp) { var uidoc = UIApp.ActiveUIDocument; var doc = uidoc.Document; var actiV = doc.ActiveView.Name; TaskDialog.Show("Command.cs - tarea2", "invocado: App.cs -> cb1_CurrentChanged(...) -> Command.Tit_rp1g2i2(e.Application)" + "\nproceso : internal static void Tit_rp1g2i2(UIApplication UIApp)" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); return; } //Empresa -> EsquemaEstándar -> Rp1g2i3 : ComboBox internal static void Tit_rp1g2i3(UIApplication UIApp) { var uidoc = UIApp.ActiveUIDocument; var doc = uidoc.Document; var actiV = doc.ActiveView.Name; TaskDialog.Show("Command.cs - tarea2", "invocado: App.cs -> cb1_CurrentChanged(...) -> Command.Tit_rp1g2i3(e.Application)" + "\nproceso : internal static void Tit_rp1g2i3(UIApplication UIApp)" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); return; } //Empresa -> EsquemaEstándar -> Rp1g2i4 : ComboBox internal static void Tit_rp1g2i4(UIApplication UIApp) { var uidoc = UIApp.ActiveUIDocument; var doc = uidoc.Document; var actiV = doc.ActiveView.Name; TaskDialog.Show("Command.cs - tarea2", "invocado: App.cs -> cb1_CurrentChanged(...) -> Command.Tit_rp1g2i4(e.Application)" + "\nproceso : internal static void Tit_rp1g2i4(UIApplication UIApp)" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); return; } //fin comandos internos } //fin clase Command [Transaction(TransactionMode.Manual)] public class Tit_rp1g2i1 : 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; var actiV = doc.ActiveView.Name; //View actiV = doc.ActiveView; string nomV = actiV.Name; // Modify document within a transaction using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); TaskDialog.Show("Command.cs", "FullPathName .addin: Prueba.Tit_rp1g2i1" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); tx.Commit(); } return Result.Succeeded; } //fin Result Execute( } //fin class Tit_rp1g2i1 [Transaction(TransactionMode.Manual)] public class Tit_rp1g2i2 : 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; var actiV = doc.ActiveView.Name; //View actiV = doc.ActiveView; string nomV = actiV.Name; // Modify document within a transaction using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); TaskDialog.Show("Command.cs", "FullPathName .addin: Prueba.Tit_rp1g2i2" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); tx.Commit(); } return Result.Succeeded; } //fin Result Execute( } //fin class Tit_rp1g2i2 [Transaction(TransactionMode.Manual)] public class Tit_rp1g2i3 : 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; var actiV = doc.ActiveView.Name; //View actiV = doc.ActiveView; string nomV = actiV.Name; // Modify document within a transaction using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); TaskDialog.Show("Command.cs", "FullPathName .addin: Prueba.Tit_rp1g2i3" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); tx.Commit(); } return Result.Succeeded; } //fin Result Execute( } //fin class Tit_rp1g2i3 [Transaction(TransactionMode.Manual)] public class Tit_rp1g2i4 : 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; var actiV = doc.ActiveView.Name; //View actiV = doc.ActiveView; string nomV = actiV.Name; // Modify document within a transaction using (Transaction tx = new Transaction(doc)) { tx.Start("Transaction Name"); TaskDialog.Show("Command.cs", "FullPathName .addin: Prueba.Tit_rp1g2i4" + "\n\nUIApp : " + UIApp + "\n doc : " + doc + "\n actiV : " + actiV); tx.Commit(); } return Result.Succeeded; } //fin Result Execute( } //fin class Tit_rp1g2i4 } //fin namespace