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

replicate a sheet of lined paper

Explorer ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

How can I go about making a part of my project that requires a series of (82) lines with identical space inbetween and same start and end points.

[Looks very much like a sheet of lined paper]

 

Wanting some programatic actions instead of struggling along with copy/paste and getting the same spacing

How to guarantee spacing will be accurate and not just cobbled to gether by hand.

TOPICS
How-to , Scripting

Views

386
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 2 Correct answers

Community Expert , Jun 02, 2023 Jun 02, 2023

You could try either the transform effect (Effect > Distort & transform > Transforn, requires just one line as a starting point, then make a graphc style to apply over and over)  or a blend (requires 2 start objects).

Votes

Translate
Guide , Jun 03, 2023 Jun 03, 2023

Draw and select the first line.  Enter the number of lines and spacing (in points) separated by a comma (e.g. 82, 10).

var inputs = prompt("", "#, spacing (pt)").split(",");
var first = app.selection[0];
for (var i = 1; i < Number(inputs[0]); i++) {
    var next = first.duplicate();
    next.top = first.top - i * Number(inputs[1]);
}

Votes

Translate
Adobe
Community Expert ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

You could try either the transform effect (Effect > Distort & transform > Transforn, requires just one line as a starting point, then make a graphc style to apply over and over)  or a blend (requires 2 start objects).

Votes

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
Guide ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

Draw and select the first line.  Enter the number of lines and spacing (in points) separated by a comma (e.g. 82, 10).

var inputs = prompt("", "#, spacing (pt)").split(",");
var first = app.selection[0];
for (var i = 1; i < Number(inputs[0]); i++) {
    var next = first.duplicate();
    next.top = first.top - i * Number(inputs[1]);
}

Votes

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
Explorer ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

quote

Draw and select the first line.  Enter the number of lines and spacing (in points) separated by a comma (e.g. 82, 10).

 

var inputs = prompt("", "#, spacing (pt)").split(",");
var first = app.selection[0];
for (var i = 1; i < Number(inputs[0]); i++) {
    var next = first.duplicate();
    next.top = first.top - i * Number(inputs[1]);
}

Above . . By @femkeblanco

 

Sorry to be so dim-witted . . .

Not sure what I am expected to do.

Just type out the program? entering correct numbers?

How to run the program?

Do I need to enter a special mode in AI to create and enter the scripting?

 

Votes

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
Guide ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

Before running the script, draw and select the first (topmost) line.

 

To run a script, copy and paste the code into a jsx file and save.  (You can create a txt file and change the extension to jsx.)  Then, while your document is open in Illustrator, go to File > Scripts > Other Script (Ctrl+F12), find your script and open it.  This will run the script.  For more on running scripts, see here.

 

When running the script, a prompt window will appear.  In the input field, enter the number of lines and spacing between lines (in points) separated by a comma (e.g. 82, 10). 

Votes

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
Explorer ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

There is an esasy way without programing....
Make two lines - the top and the bottom. Choose the  BLEND TOOL. Click on one end of the upper line, hold down ALT and then the corepsponding anchor point on the lower line. No choose how many steps you want (you get a small menue with diffrent ways to blend). Since you have the upper and lower - that makes 80 steps. Now you have 82 lines with exact spacing. And if you want 83, you just cklick agin and change the numbers of steps. 

Votes

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 ,
Jun 03, 2023 Jun 03, 2023

Copy link to clipboard

Copied

LATEST

Although the script from femkeblanco works very well, just enter the number of lines and distance divided by a comma, the suggestion made by Monika, use the Transform Effect, is very easy, editable, and can be saved as an Object Style for one click reuse.

Screenshot 2023-06-03 at 22.46.43.png

Votes

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