using System; using Autodesk.Revit; using Autodesk.Revit.Elements; using System.Windows.Forms; using Autodesk.Revit.Creation; namespace trova_coord { [System.AddIn.AddIn("ThisApplication", Version = "1.0", Publisher = "", Description = "")] public partial class ThisApplication { private void Module_Startup(object sender, EventArgs e) { } private void Module_Shutdown(object sender, EventArgs e) { } #region VSTA generated code private void InternalStartup() { this.Startup += new System.EventHandler(Module_Startup); this.Shutdown += new System.EventHandler(Module_Shutdown); } #endregion public void cerca_punto() { ElementIterator iteratore = ActiveDocument.get_Elements(typeof(ReferencePoint)); String coord = String.Format("LE COORDINATE DEI PUNTI DI RIFERIMENTO SELEZIONATI SONO: \n\n\n" ); while (iteratore.MoveNext()) { Element elemento = iteratore.Current as Element; String x = "X"; String y = "Y"; String z = "Z"; ReferencePoint elementosel = elemento as ReferencePoint; Autodesk.Revit.Geometry.XYZ posizione = elementosel.Position; coord += String.Format("{0,-30} {1,45} {2,75}\n{3,-60} {4,0} {5,60}\n\n", x, y, z, posizione.X, posizione.Y, posizione.Z); } MessageBox.Show(coord); }