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

VB Syntax Help for Pathpoint Anchor

Engaged ,
Nov 03, 2013 Nov 03, 2013

Copy link to clipboard

Copied

Greetings, Friends!

I think that I am about to slap myself silly, as I know that as soon as I am presented the solution, I'll do one of those "Dang - I knew that", but after a few hours of trying, I'm currently coming up empty.

Here's the problem: I am trying to (among other things) move a pathpoint that was added on a pathitem rectangle. The add of the pathitem goes well, the add of the pathpoint to the rectangle is fine, although when it it is "added" it picks some arbitrary position, hence the need to change the position, starting with the anchor.

I typically write in VB.NET (2013), as I am doing here. Using Illustrator CS6.

In VBScript, documentation shows:

    newPoint.Anchor = Array(75, 300)

Using that syntax, I get a pre-complier error in VB.NET, as "Array" is a type and can't be used as an expression.

To create an inline array in VB.NET, I would normally use:

    newPoint.Anchor = {75, 300}

Using this syntax, I get a runtime COM-exception error.

Any help would be GREATLY appreciated!!!

Thank you in advance,

TT

TOPICS
Scripting

Views

908

Translate

Translate

Report

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

correct answers 1 Correct answer

Engaged , Nov 04, 2013 Nov 04, 2013

Greetings! Wow - what a difference a good night's sleep makes.So  I guess I get to answer my own thread. Sure is lonely out here...

Maybe someone else can use this info (if there "IS" anyone else out there who uses VB.NET with AI Scripting).

So... in VB.NET, this does NOT work either:

     Dim newArray As Array = {x, y}

nor this:

     Dim newArray As Object = {x, y}

However, doing a "long-handed" array does (I simply created a function):

    

     pathPoint.Anchor = Array(123.123, -012.012)

     Priva

...

Votes

Translate

Translate
Adobe
Engaged ,
Nov 04, 2013 Nov 04, 2013

Copy link to clipboard

Copied

Greetings! Wow - what a difference a good night's sleep makes.So  I guess I get to answer my own thread. Sure is lonely out here...

Maybe someone else can use this info (if there "IS" anyone else out there who uses VB.NET with AI Scripting).

So... in VB.NET, this does NOT work either:

     Dim newArray As Array = {x, y}

nor this:

     Dim newArray As Object = {x, y}

However, doing a "long-handed" array does (I simply created a function):

    

     pathPoint.Anchor = Array(123.123, -012.012)

     Private Function Array(x As Double, y As Double) As Object

          Dim newArray(1) '2 screen position points

          newArray(0) = x

          newArray(1) = y

          Return newArray

     End Function

Not sure why .NET with AI Scripting is so touchy... Hope this helps someone.

-TT

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 04, 2013 Nov 04, 2013

Copy link to clipboard

Copied

good, thanks for posting the solution

how about this (I wouldn't know how to try vb.net)

newPoint.Anchor = [{75, 300}]

Votes

Translate

Translate

Report

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
Engaged ,
Nov 04, 2013 Nov 04, 2013

Copy link to clipboard

Copied

LATEST

Hi Carlos,

Gave it a try and the precompiler prompts an error "End of Statement expected". Tried inverting the positions of the braces and square brackets, but got the same error. Thanks you very much, though, for the suggestion -- it was surely worth a try!

Which leads me to my next thought -- I think that you and I should get together -- say at the upcoming Adobe Scripting Forum Christmas Party (which I am sure that you are busily preparing and making arrangements for the guest speakers, etc., etc...) --- and I'll teach you VB.NET and you can teach me VBScript? What do you think?!?

Thanks again, my friend, for the suggestion.

-TT

Votes

Translate

Translate

Report

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