2 Replies Latest reply on Jul 25, 2013 12:50 AM by joseph.spang1

    How to work with textColl

    joseph.spang1

      Hello,

       

      I'm trying to modify text angle on a user layer.

       

      After creating text collection with this:

       

         Set textsColl = docObj.UserLayerTexts(epcbSelectAll,ulayerToProcess,True)

       

      I want to change text orientation:

       

      If Format.Orientation = 0 Or Format.Orientation = 180 Then

        If Not Format.Orientation(epcbAngleUnitDegrees) = 0.0 Then

        Format.Orientation(epcbAngleUnitDegrees) = 0.0

        End If

      Else

        If Not Format.Orientation(epcbAngleUnitDegrees) = 90 Then

        Format.Orientation(epcbAngleUnitDegrees) = 90

        End If

      End If

       

      Error message: object required Format.Orientation

       

      Thanks for your help

       

      Joseph

        • 1. Re: How to work with textColl
          andrew_french

          you need to iterate through your collection of text items and do your work on that specific item so roughly

           

          foreach textItem ti in textsColl

           

          ti.format.orientation = x

           

           

          very rough example.

          • 2. Re: How to work with textColl
            joseph.spang1

            Hi Andrew,

             

            Thanks, in fact I missed to  Set textFormatObj = textObj.Format

             

              Set textsColl = docObj.UserLayerTexts(epcbSelectAll, "PartLabelTop", True)

              For Each textObj In textsColl

               Set textFormatObj = textObj.Format

             

              ' Change text orientation to 0 or 90 deg.

              If textFormatObj.Orientation = 0 Or textFormatObj.Orientation = 180 Then

               If Not  textFormatObj.Orientation(epcbAngleUnitDegrees) = 0.0 Then

                 textFormatObj.Orientation(epcbAngleUnitDegrees) = 0.0

               End If

              Else

               If Not  textFormatObj.Orientation(epcbAngleUnitDegrees) = 90 Then

                 textFormatObj.Orientation(epcbAngleUnitDegrees) = 90

               End If

              End If

             

            It works now

             

            Regards,

            Joseph