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

use 'line segment tool' in script ?

Community Beginner ,
Aug 28, 2008 Aug 28, 2008
hi there!

does anyone know if the line segment tool can be used in a script? i mean drawing a line segment by inputing a starting point, an angle and a length.
i searched in the adobe reference pdf and on google, but couldn't find the answer.

(i am writing in JS)

thanks!
TOPICS
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
Adobe
LEGEND ,
Aug 28, 2008 Aug 28, 2008
You don't "use a tool" to draw a path in Javascript. But you can create paths programmatically. See the Javascript Reference and look at PathItems method add() and PathItem method setEntirePath().

JET
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
Community Beginner ,
Aug 29, 2008 Aug 29, 2008
LATEST
yeah...what i meant was if i could generate a path in a similar way with the line segment tool, where you input the starting point, an angle an a length. i thought maybe adobe made a build-in method to do this. seems not, but it's quite easy to do it manually. it's something like this:

let's say x and y are the coordinates of the starting point, then:
first anchorpoint [x,y]
second anchorpoint [ x+cos(angle_in_radians)*length_in_points , y+sin(angle_in_radians)*length_in_points]
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