/// <summary>
        /// Converts the specified PSAnnotation into a series of PSCompCurves
        /// </summary>
        /// <param name="annotationToConvert">The annotation to convert</param>
        /// <returns>A list of PSCompCurves</returns>
        /// <remarks>The original PSAnnotation will no longer exist after this operation</remarks>
        public List <PSCompCurve> CreateCompCurvesFromAnnotation(PSAnnotation annotationToConvert)
        {
            List <PSAnnotation> annotations = new List <PSAnnotation>();

            annotations.Add(annotationToConvert);
            return(CreateCompCurvesFromAnnotations(annotations));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new annotation in PowwerSHAPE.
        /// </summary>
        /// <param name="powerSHAPE">The base instance to interact with PowerShape.</param>
        /// <param name="text">The text to introduce in PowerShape.</param>
        /// <param name="fontName">
        /// The font type for the text (e.g. Arial, Times New Roman). The font Type must exist in
        /// PowerShape.
        /// </param>
        /// <param name="height">The font height.</param>
        /// <param name="pitch">The distance between each character in a line.</param>
        /// <param name="textJustification">
        /// The wanted justify option. This is how the text in the block aligns with the left and
        /// right margins.
        /// </param>
        /// <param name="textOrigin">
        /// The origin of the text block. The origin is the 'anchor point' used to position the text and
        /// can be set at any of the four corners of the text box, the mid points of the sides of the text box or the centre of the
        /// text box. Use the option menu to change the origin of the text.
        /// </param>
        /// <param name="position">The position of the text in the active workplane.</param>
        /// <remarks></remarks>
        internal PSAnnotation(
            PSAutomation powerSHAPE,
            string text,
            string fontName,
            double height,
            Point position,
            double pitch,
            TextJustifications textJustification,
            TextOrigins textOrigin) : base(powerSHAPE)
        {
            // Create text in PowerSHape
            CreateText(powerSHAPE, height, fontName, pitch, textOrigin, textJustification, position, text);

            //Now get its Id
            PSAnnotation annotation = (PSAnnotation)_powerSHAPE.ActiveModel.CreatedItems[0];

            _id   = annotation.Id;
            _name = annotation.Name;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new annotation in PowwerSHAPE.
        /// </summary>
        /// <param name="powerSHAPE">The base instance to interact with PowerShape.</param>
        /// <param name="text">The text to introduce in PowerShape.</param>
        /// <param name="fontName">
        /// The font type for the text (e.g. Arial, Times New Roman). The font Type must exist in
        /// PowerShape.
        /// </param>
        /// <param name="height">The font height.</param>
        /// <param name="position">The position of the text in the active workplane.</param>
        /// <remarks>The created text will have pitch of 0, text origin will be 'CENTRE' and text justification will be 'LEFT'.</remarks>
        internal PSAnnotation(
            PSAutomation powerSHAPE,
            string text,
            string fontName,
            double height,
            Point position) : base(powerSHAPE)
        {
            //Clear the list of CreatedItems
            _powerSHAPE.ActiveModel.ClearCreatedItems();

            // Create text in PowerSHape
            CreateText(powerSHAPE, height, fontName, 0, TextOrigins.Centre, TextJustifications.Left, position, text);

            //Now get its Id
            PSAnnotation annotation = (PSAnnotation)_powerSHAPE.ActiveModel.CreatedItems[0];

            _id   = annotation.Id;
            _name = annotation.Name;
        }