Example #1
0
        internal PSSurfaceBlock(PSAutomation powershape, Point origin) : base(powershape)
        {
            // Clear CreatedItems
            _powerSHAPE.ActiveModel.ClearCreatedItems();

            // Create a plane at the point specified
            _powerSHAPE.DoCommand("CREATE SURFACE BLOCK");
            _powerSHAPE.DoCommand(origin.ToString());

            // Get created plane id
            PSSurfaceBlock newBlock = (PSSurfaceBlock)_powerSHAPE.ActiveModel.CreatedItems[0];

            _id = newBlock.Id;
        }
        /// <summary>
        /// Creates a new surface block at the specified origin, with the specified height, width, length
        /// and draft angle for all walls.
        /// </summary>
        /// <param name="origin">The origin at which to create the block.</param>
        /// <param name="width">The width of the block.</param>
        /// <param name="length">The length of the block.</param>
        /// <param name="height">The height of the block.</param>
        /// <param name="draftAngle">The draft angle to use for all walls.</param>
        /// <returns>The created block.</returns>
        public PSSurfaceBlock CreateBlock(
            Geometry.Point origin,
            Geometry.MM width,
            Geometry.MM length,
            Geometry.MM height,
            Geometry.Degree draftAngle)
        {
            PSSurfaceBlock block = new PSSurfaceBlock(_powerSHAPE, origin);

            block.Width       = width;
            block.Length      = length;
            block.Height      = height;
            block.DraftAngle1 = draftAngle;
            block.DraftAngle2 = draftAngle;
            block.DraftAngle3 = draftAngle;
            block.DraftAngle4 = draftAngle;
            Add(block);
            return(block);
        }