4 Replies Latest reply on Jul 26, 2016 9:37 PM by CarlosCanto

    line of code gives me an array. But why?

    daneJ Level 1

      I am having some coding trouble. refArtboard.ArtboardRect is an array in illustrator that contains the 4 entries regard position.

      When i run: refArtboardX = refArtboard.ArtboardRect(0) i get the first entry in the array as a double.

      i have moved this part of the code into a subroutine. when i go in to the sub and reach this line: refArtboardX = refArtboard.ArtboardRect(0) then refArtboardX becomes an array containing all 4 refArtboard.ArtboardRect entries rather then a single value. I can not figure out what is going wrong here. i tried diming it as a double but just got an error. I can put any number at all at the end of refArtboard.ArtboardRect(0) but the result is alway the array(0 to 3). does anyone have any ideas what could be going wrong here. If anyone has some thought i  would be very interested to hear them.

      i have pasted in more of the code below to give more context.

       

      Set refArtboard = doc.Artboards.GetByName("L&A")

       

                          refArtboardName = refArtboard.Name

                          Set layerChoice = idoc.Layers(refArtboardName)

                          refArtboardX = refArtboard.ArtboardRect(0)

                          Set newSymbol = symbolMethod.Add(refSymbol("LL #15"))

                          Set bottomLftSymbolRef = newSymbol

                          newSymbol.Left = refArtboardX + marginRef

                          newSymbol.Top = refArtboard.ArtboardRect(3) + newSymbol.Height + marginRef

                          lastSymbolLeft = newSymbol.Left

                          lastSymbolTop = newSymbol.Top

                          newSymbol.Move layerChoice, aiPlaceAtBeginning

                          Set newSymbol = symbolMethod.Add(refSymbol("LL #14,15OR"))

                          newSymbol.Left = lastSymbolLeft + newSymbol.Width + 14

                          newSymbol.Top = lastSymbolTop

                          newSymbol.Move layerChoice, aiPlaceAtBeginning

       

      Thanks alot.

      Dane