/// <summary> /// Creates a new surface cylinder at the specified origin, radius and length. /// </summary> /// <param name="origin">The origin at which to create the cylinder.</param> /// <param name="radius">The radius of the cylinder.</param> /// <param name="length">The length of the cylinder.</param> /// <returns>The created cylinder.</returns> public PSSurfaceCylinder CreateCylinder(Geometry.Point origin, Geometry.MM radius, Geometry.MM length) { PSSurfaceCylinder cylinder = new PSSurfaceCylinder(_powerSHAPE, origin); cylinder.Radius = radius; cylinder.Length = length; Add(cylinder); return(cylinder); }
internal PSSurfaceCylinder(PSAutomation powershape, Point origin) : base(powershape) { // Clear CreatedItems _powerSHAPE.ActiveModel.ClearCreatedItems(); // Create a plane at the point specified _powerSHAPE.DoCommand("CREATE SURFACE CYLINDER"); _powerSHAPE.DoCommand(origin.ToString()); // Get created plane id PSSurfaceCylinder newCylinder = (PSSurfaceCylinder)_powerSHAPE.ActiveModel.CreatedItems[0]; _id = newCylinder.Id; }