示例#1
0
        /// <summary>
        /// Creates a new solid cylinder at the specified origin, radius and length.
        /// </summary>
        /// <param name="origin">Origin at which to create the cylinder.</param>
        /// <param name="radius">Radius of the cylinder.</param>
        /// <param name="length">Length of the cylinder.</param>
        /// <returns>The created cylinder.</returns>
        public PSSolidCylinder CreateCylinder(Point origin, MM radius, MM length)
        {
            PSSolidCylinder cylinder = new PSSolidCylinder(_powerSHAPE, origin);

            cylinder.Radius = radius;
            cylinder.Length = length;
            Add(cylinder);
            return(cylinder);
        }
示例#2
0
        internal PSSolidCylinder(PSAutomation powershape, Point origin) : base(powershape)
        {
            // Clear CreatedItems
            _powerSHAPE.ActiveModel.ClearCreatedItems();

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

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

            _id = newCylinder.Id;
        }