Ejemplo n.º 1
0
        /// <summary>
        /// Adds a point cloud instance programmatically.
        /// </summary>
        /// <param name="doc">The document.</param>
        /// <param name="engineType">The engine identifier string.</param>
        /// <param name="identifier">The identifier for the particular point cloud.</param>
        /// <param name="trf">The transform to apply to the new point cloud instance.</param>
        public void AddInstance(Document doc, String engineType, String identifier, Transform trf)
        {
            Transaction t = new Transaction(doc, "Create PC instance");

            t.Start();
            PointCloudType type = PointCloudType.Create(doc, engineType, identifier);

            PointCloudInstance.Create(doc, type.Id, trf);
            t.Commit();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a point cloud.
        /// </summary>
        /// <param name="document">The active document</param>
        /// <param name="identifier">The name of the point cloud</param>
        /// <param name="points">The points</param>
        /// <param name="transform">The transform</param>
        protected void CreatePointCloud(Document document, string identifier, CloudPoint[] points, Transform transform)
        {
            t_pending_points = points;

            using (Transaction t = new Transaction(document, identifier))
            {
                t.Start();
                PointCloudType     type     = PointCloudType.Create(document, m_identifier, identifier);
                PointCloudInstance instance = PointCloudInstance.Create(document, type.Id, transform);
                PointCloudBase     new_pc   = m_pointclouds.Last();
                new_pc.ElementId = instance.Id;
                new_pc.Document  = document;
                new_pc.Engine    = this;
                t.Commit();
            }
        }