An implementation for a non file-based point cloud. In this implementaiton, the location of the cells, including their colors and options, are hardcoded.
Inheritance: PointCloudAccessBase, IPointCloudAccess
コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: PointCloudEngineSample.cs プロジェクト: AMEE/revit
        /// <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;
        }