Ejemplo n.º 1
0
        /// <summary>
        /// Inserts the specified Boundary into this Boundary.
        /// </summary>
        /// <param name="boundary">The boundary to insert into this Boundary.</param>
        public void InsertBoundary(PMBoundary boundary)
        {
            if (boundary == null || !boundary.Exists)
            {
                throw new ArgumentNullException("boundary", "Boundary not found");
            }

            PowerMill.DoCommand("EDIT BOUNDARY '" + Name + "' INSERT BOUNDARY '" + boundary.Name + "'");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts the specified Boundary into this Boundary.
        /// </summary>
        /// <param name="boundaryName">The name of the boundary to insert into this Boundary.</param>
        public void InsertBoundaryByName(string boundaryName)
        {
            PMBoundary boundary = PowerMill.ActiveProject.Boundaries.GetByName(boundaryName);

            if (boundary == null || !boundary.Exists)
            {
                throw new ArgumentNullException("boundary", "Boundary not found");
            }

            PowerMill.DoCommand("EDIT BOUNDARY '" + Name + "' INSERT BOUNDARY '" + boundary.Name + "'");
        }
        /// <summary>
        /// This operation creates a Block in PowerMILL from an boundary. The heights are calculated automatically
        /// </summary>
        /// <param name="boundary">The boundary from which to create the block.</param>
        public BoundingBox CreateBlockFromBoundary(PMBoundary boundary)
        {
            _powerMILL.DoCommand("EDIT MODEL ALL DESELECT ALL");
            _powerMILL.DoCommand(string.Format("ACTIVATE BOUNDARY \"{0}\"", boundary.Name));
            _powerMILL.DoCommand("EDIT BLOCKTYPE BOUNDARY");
            _powerMILL.DoCommand("EDIT BLOCK RESETLIMIT 0");
            _powerMILL.DoCommand("EDIT BLOCK RESET");
            _powerMILL.DoCommand("BLOCK ACCEPT");
            BoundingBox boundingBox = GetBlockLimits();

            return(boundingBox);
        }
        /// <summary>
        /// This operation creates a Block in PowerMILL from an boundary. The heights are calculated automatically
        /// </summary>
        /// <param name="boundary">The boundary from which to create the block.</param>
        public BoundingBox CreateBlockFromBoundary(PMBoundary boundary)
        {
            if (boundary == null || !boundary.Exists)
            {
                throw new ArgumentNullException("boundary", "Boundary not found");
            }

            _powerMILL.DoCommand("EDIT MODEL ALL DESELECT ALL");
            _powerMILL.DoCommand(string.Format("ACTIVATE BOUNDARY \"{0}\"", boundary.Name));
            _powerMILL.DoCommand("EDIT BLOCKTYPE BOUNDARY");
            _powerMILL.DoCommand("EDIT BLOCK RESETLIMIT 0");
            _powerMILL.DoCommand("EDIT BLOCK RESET");
            _powerMILL.DoCommand("BLOCK ACCEPT");
            BoundingBox boundingBox = GetBlockLimits();

            return(boundingBox);
        }