Highlighted

Rotate an entire document with all elements 90 degrees

Participant ,
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?

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

 

TOPICS
Scripting

Views

52

Likes

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

Rotate an entire document with all elements 90 degrees

Participant ,
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?

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

 

TOPICS
Scripting

Views

53

Likes

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
Oct 20, 2020 0
Engaged ,
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

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 20, 2020 0
Resources