Rotate an entire document with all elements 90 degrees

Participant ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

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

Views

115

Likes

translate

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

Enthusiast , 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( ...

Likes

translate

Translate

Translate
Enthusiast ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

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" );

 

Likes

translate

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