Copy link to clipboard
Copied
I'm working on some isometric illustrations and have set up some actions/shortcuts to speed up my workflow. These work fine *if* I draw the object and then immediately run the action, however, I've discovered that *if* have done any rotation or previous transformation to my object(s) {(which is often necessary for me in order to 'discover' my desired result)} - the results are totally whacked out (compared to my usual/desired results).
I'm left wondering– is there any way to 'clear' the info. that is likely related to and residing with the object that I have worked with? That way I can rotate, tweak and test as many options as needed in getting my shape to just the right form before applying my actions.
Thanks,
Dave
Copy link to clipboard
Copied
Hi Dave,
I'm not sure if this'll help in your case, but Illustrator attaches a hidden 'tag' to any item that is manually rotated and tries to keep track of it by adjusting the tag value every time the item is rotated. So I wondered if you could try removing the tag before running your script/action?
This snippet will remove the tag from the first selected item.
var item = selection[0];
removeRotationTag(item);
function removeRotationTag(item) {
if (item.tags.length > 0) {
if (item.tags[0].name == "BBAccumRotation") {
item.tags[0].remove();
}
}
}
- Mark
Copy link to clipboard
Copied
Mark,
Thanks for the suggestion. How would I go about removing the tag you speak of?
Copy link to clipboard
Copied
The script I posted will remove the tag from the first selected item. Can you see if it makes a difference? If it works you can perhaps incorporate it in your overall script.
- Mark
Copy link to clipboard
Copied
This should be a bit more thorough:
function removeRotationTag(item) {
if (item.typename === "GroupItem") {
removeAllRotationTags(item.pageItems)
} else {
try {
item.tags.getByName("BBAccumRotation").remove()
} catch (_) {}
if (item.typename === "CompoundPathItem") {
removeAllRotationTags(item.pathItems)
}
}
}
function removeAllRotationTags(items) {
for (var i = 0; i < items.length; i++) {
removeRotationTag(items[i])
}
}
removeAllRotationTags(app.activeDocument.selection)
Copy link to clipboard
Copied
Mark,
Thank you for being kind enough to take the time to do this- however, I'm afraid it's still over my head. I'm just used to creating pretty simple actions using the actions palette.
Thanks,
Dave
Copy link to clipboard
Copied
Copy and paste the code into a plain text file and save it with a .jsx extension.
In AI, select the objects from which you want to remove rotation info.
To run the script, click File > Scripts > Other Script and choose the JSX file. The script should only take a moment to run.
If you need to run it frequently, copy the script to AI’s “Presets/Scripts” folder and relaunch AI. The script will then appear in the File > Scripts menu.
Copy link to clipboard
Copied
Thanks - I'll create that and give it a shot while I'm working on some files. I'll report back to let you know how it goes.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Which version of Illustrator are you using?
Also, can you provide some of the actions you are talking about (including additional instructions, if necessary)?
And perhaps some sketches that may explain your request a bit better?