Help me create a macro to change Model Space Scale

Hi,

I would like a macro to increase/decrease the Model space scale.

Ideally would work as follows:

  • one macro to increase the scale by 25 each time it runs
  • one macro to decrease the scale by 25 each time it runs
  • I want to bind these macro’s to simple button (combinations)

Don’t know if this is possible:

  • if nothing is selected: change the general scale of the entire document, so change all dimensions at once
  • if one is selected: only change the scale of the selected dimension

All help is welcome, I’ve only tried to make a couple simple macro’s. I’m unsure how to do the +/- 25 thing. Also unsure about the second request… All help is welcome. Thanks in advance :slight_smile:

Can anyone tell me if this is even possible?

Can you do mathematic operations in a Macro?

Do you mean you want to change the units of Rhino via a script? Or you want to scale your model(s) with a scipt?

I think neither. I think he wants to change the model space scale of dimension objects.

Yes, it’s possible with a script.

In V6 you can. For example this works:

! _SelAll _Scale 0 ((6*3)/2)

You can probably do trig as well… I wouldn’t want to get into complex equations though.

In V5, the only math accepted at the command line (and thus in a macro) is division / .

HTH, --Mitch

1 Like

Yes I am talking about this option:

My job involves creating drawings for logos etc. Which come in many different sizes and shapes, so very often the dimension text is so small it’s unreadable or too big it’s annoying. So I would like to have 2 shortcuts, one for scaling the dimension text up and the other for scaling down.

I’m using Rhino V5.

Hi Simon - It does not look like that setting is exposed for a macro. You can make things a little quicker if you know the dim style name with something like

! _DocumentPropertiesPage MillimeterArchitectural

-Pascal

Here is an old Rhinoscript from V5 that still works in V6. Interestingly enough, it is not possible in Python rhinoscriptsyntax, the scale method is missing…

I can probably tweak this somewhat to make it look for a particular dimstyle and use a particular scale if necessary - but I really hate going back to Rhinoscript…

ApplyScaleAllDimStyles.rvb (640 Bytes)

Hi Helvetosaur,

Yeah that’s almost what I’m looking for.

If it’s not too much trouble, could you tweak this one just a little bit? Don’t bother looking for a particular style etc. The only change I want is following: The current script gives the user an input field to enter a dimension style. I just want the script to add 25 to the current value of model space scale. And then another script to detract 25 from the the current value.

So then I can bind each of the scripts to a button on my keyboard to incrementally increase/decrease the size of the dimensions.

(I can just barely make out what the script is doing, my programming skills are almost non-existant :slight_smile: )

OK, here are a couple of scripts you can put on a button.

The first scales all dimstyles in the document by a fixed factor. Right now the scale factor is set at 2 - it doubles the scale on each run. You can change the factor by changing the number here:

image

The second increments the size as you requested. The increment is set at 10, you can change the increment by changing the number here:

image

The number in the first script must be positive (scale factor). Numbers greater than 1 will increase the size, less than 1 will decrease.

In the second script a positive number will increase the size, a negative number will decrease it. It will not allow a dimension factor to be reduced to a negative value.

ScaleAllDimStylesFactor.rvb (619 Bytes)

IncrementAllDimStylesScales.rvb (688 Bytes)

HTH, --Mitch

2 Likes

Hi Mitch,

Thanks so much. Works like a charm!