/// <summary> /// The implementation for IExternalCommand.Execute() /// </summary> /// <param name="commandData">The Revit command data.</param> /// <param name="message">The error message (ignored).</param> /// <param name="elements">The elements to display in the failure dialog (ignored).</param> /// <returns>Result.Succeeded</returns> public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { PredefinedPointCloud cloud = new PredefinedPointCloud("dummy"); XDocument doc = new XDocument(); XElement root = new XElement("PointCloud"); cloud.SerializeObjectData(root); doc.Add(root); TextWriter writer = new StreamWriter(@"c:\serializedPC.xml"); doc.WriteTo(new XmlTextWriter(writer)); writer.Close(); return(Result.Succeeded); }
/// <summary> /// The implementation for IExternalCommand.Execute() /// </summary> /// <param name="commandData">The Revit command data.</param> /// <param name="message">The error message (ignored).</param> /// <param name="elements">The elements to display in the failure dialog (ignored).</param> /// <returns>Result.Succeeded</returns> public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { PredefinedPointCloud cloud = new PredefinedPointCloud("dummy"); XDocument doc = new XDocument(); XElement root = new XElement("PointCloud"); cloud.SerializeObjectData(root); doc.Add(root); TextWriter writer = new StreamWriter(@"c:\serializedPC.xml"); doc.WriteTo(new XmlTextWriter(writer)); writer.Close(); return Result.Succeeded; }