Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Declaring vectors in VBScript?

New Here ,
Aug 17, 2015 Aug 17, 2015

Hey everyone,

I'm trying to write a very simplistic 3ds max-Photoshop interop so I'm making a class library and I've encountered a problem.

First, my maxscript collects an array of UV vertex coordinates and passes them to Photoshop to fiddle with. These coordinates are vector variables, e.g. [1.0, 0.0]

I tried to treat this data as double data type but the number of arguments is invalid. I tried importing it as Array but I keep getting a "No method found which matched the argument list" error.

So how do I go about processing vectors in VB and what data type do I use? (I'm very new to this so I might be missing something painfully obvious, sorry)

Thank you!

Here's the code example (this one causes the "No method found" error):

Imports Photoshop

Public Class maxtoPS

    Public PSDapp As Photoshop.Application

    Public Sub New()

        PSDapp = CreateObject("Photoshop.Application")

    End Sub

    Public Sub Makepath(ByVal Coords() As Array)

        Dim lineArray(1), lineSubPathArray(0), Anchor1(2), Anchor2(2), docRef, myPathItem, fincoords(,)

        PSDapp.Preferences.RulerUnits = 1

        PSDapp.Preferences.TypeUnits = 1

        docRef = PSDapp.Documents.Add(1024, 1024, 72, "Simple Line")

        For index = 0 To Coords.GetUpperBound(0)

            fincoords(1, 1) = Coords(index)

            fincoords(1, 1) = CInt(fincoords(1, 1))

            lineArray(index) = CreateObject("Photoshop.PathPointInfo")

            lineArray(index).Kind = 2

            lineArray(index).Anchor = fincoords(1, 1)

            lineArray(index).LeftDirection = lineArray(0).Anchor

            lineArray(index).RightDirection = lineArray(0).Anchor

        Next

        lineSubPathArray(0) = CreateObject("Photoshop.SubPathInfo")

        lineSubPathArray(0).operation = 2

        lineSubPathArray(0).Closed = False

        lineSubPathArray(0).entireSubPath = lineArray

        myPathItem = docRef.PathItems.Add("Line", lineSubPathArray)

    End Sub

End Class

TOPICS
Actions and scripting
520
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Adobe