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

Rotate an entire document with all elements 90 degrees

Engaged ,
Oct 20, 2020 Oct 20, 2020

Using extended panel I'm trying to rotate an entire document and it's elements 90 degrees. 

The document consist of about 30 layers with some "hidden" meaning they are not displaying because they don't have any elements.  The rotation would have to be on everything including artboard.  Basically the equivalent of highlighting all and then "rotating" on the AI interface.

 

I've tried the rotate script: https://github.com/mprewitt/AI-Rotate-Artboard

It doesn't work as it says it's extremly buggy.

Is this possible in illustrator scripting?

TOPICS
Scripting
867
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

correct answers 1 Correct answer

Guide , Oct 20, 2020 Oct 20, 2020

This is a basic idea:

var groups = app.activeDocument.groupItems;
var d = app.activeDocument.artboards[0].artboardRect;
rect1 = app.activeDocument.pathItems.rectangle(d[1], d[0], d[2], -d[3]);
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( "group" );
groups[0].rotate(-90);
app.executeMenuCommand( "deselectall" );
rect1.selected = true;
app.executeMenuCommand( "setCropMarks" );
app.activeDocument.artboards[0].remove();
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( 
...
Translate
Adobe
Guide ,
Oct 20, 2020 Oct 20, 2020
LATEST

This is a basic idea:

var groups = app.activeDocument.groupItems;
var d = app.activeDocument.artboards[0].artboardRect;
rect1 = app.activeDocument.pathItems.rectangle(d[1], d[0], d[2], -d[3]);
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( "group" );
groups[0].rotate(-90);
app.executeMenuCommand( "deselectall" );
rect1.selected = true;
app.executeMenuCommand( "setCropMarks" );
app.activeDocument.artboards[0].remove();
app.executeMenuCommand( "selectall" );
app.executeMenuCommand( "ungroup" );
app.executeMenuCommand( "deselectall" );

 

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