[Maxscript/dotnet] Vector variables in VB?

Hey everyone,
I’m trying to make a very simple 3ds max -> Photoshop interop and I’m making a COM class library. What it does is pass UV vertex coordinates from max to PS to fiddle with but when I try to import them into PS I get an error because apparently VBScript doesn’t quite have a vector data type. I tried importing my coords as double and as arrays but I keep getting the “No method found which matched the argument list” error. The UV coords are vector variables that look something like this: [0.43768, 1.0] Splitting them up into floats in maxscript seems like a very weird solution so I’m curious if there is a way to treat vector data in VBScript.
Thank you :slight_smile:

PS: bonus question: how do I properly debug that sort of thing? I need to replace the dll, re-launch 3ds max, and run the script every time I tweak something which seems like a lot of time wasted.

Here is the example of the code (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), 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