Skip to main content
Inspiring
October 11, 2024
Pregunta

How to correctly change the common units of the current document?

  • October 11, 2024
  • 3 respuestas
  • 726 visualizaciones

To change current documet units I use this: 

 

function setUnits() {
    var units = 5; //(0 to 6)
    app.preferences.setIntegerPreference("rulerType", units);
}

 

When I say "current documet units" I mean the units of measurement in the transformation window and on the ruler. 
However, in order to “see” the new units of measurement, you need to create a new document.

 

How can I make these changes appear in the current document?

Este tema ha sido cerrado para respuestas.

3 respuestas

Sergey Osokin
Inspiring
October 14, 2024

Not the easiest way, but for PC users, we can launch the Document Setup window with app.executeMenuCommand("document") and then run a VBScript that emulates keystrokes to select units from the drop down list.

christianot40873293
Community Expert
Community Expert
October 11, 2024

In the file > document configuration tab (Alt+Ctrl+P) I can change the document's unit of measurement, when I change it there it ignores the default unit settings that are in Edit>preferences>units

This change affects everything, including the transform window and the rulers.

From what I understand, that would be it, right?

renél80416020
Inspiring
October 11, 2024

Un clic droit sur l'une des règles,

 

m1b
Community Expert
Community Expert
October 11, 2024

Well, wow, amazingly there doesn't seem to be any good way to do this. Incredible! Sorry for bad news. I take it you've seen the workarounds, such as making new document and copy/pasting, or saving uncompressed and editing raw .ai file? Both terrible options when all you want to do is set the document ruler units. SIgh.

- Mark

m1b
Community Expert
Community Expert
October 11, 2024

I have lodged a bug report. Please vote to have it fixed. - Mark