2 Replies Latest reply on Jun 14, 2015 9:19 PM by joseph.spang1

    Script under EE7.9.5

    joseph.spang1

      Hi,

       

      It seems the Block.AddText command didn't work under the EE7.9.5 release!

       

      for each Line in LineList.ToArray()

        Block.AddText Line,X,Y

        Y=Y-DeltaY

      Next

       

      I looked the documentation but nothing change!

      Any idea?

       

      Joseph

        • 1. Re: Script under EE7.9.5
          Patrick.Cashman

          Though I have not tested it specifically with 7.9.5, the following script works fine in both 7.9.4 and VX:

           

          Sub Cmd_testClick(sender As Object, e As EventArgs)

                   Dim list As New ArrayList

                   Dim block As ViewDraw.Block

                   Dim comp As ViewDraw.Component

                   Dim tmp As String

                   Dim x, y As Long

                  

                   list.Clear

                   list.Add("1st line")

                   list.Add("2nd line")

                   list.Add("3rd line")

                   list.Add("4th line")

                  

                   view = app.ActiveView

                   comps = view.Query(128, 1)

                  

                   For Each comp In comps

                       x = comp.GetLocation.X

                       y = comp.GetLocation.Y

                      

                       block = comp.SymbolBlock

                      

                       For Each tmp In list

                           block.AddText(tmp, x, y)

                           y = y - 10

                       Next

                   Next

               End Sub

          The only thing I can see in your code that causes an error for me is the lack of parentheses in the AddText command.  That may not matter if you are using vbscript or the EFM scripting, but it does in vb.net.

           

          I hope this helps you. 

          • 2. Re: Script under EE7.9.5
            joseph.spang1

            Hi Patrick,

             

            Thanks.

            In fact the script works...

            I meet some problems with the scout.ini file.

             

            Joseph