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

    How to work with textColl




      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


        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



        • 1. Re: How to work with textColl

          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

            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


               If Not  textFormatObj.Orientation(epcbAngleUnitDegrees) = 90 Then

                 textFormatObj.Orientation(epcbAngleUnitDegrees) = 90

               End If

              End If


            It works now