Code to set automatic dynamic block unit

Hey! I’m Fran Madeira, I’m an architect and I’m starting studies with ruby and I can’t solve a question. I’m using sketchup’s ruby console to develop dynamic blocks, through codes to put information in them like LenX, LenY and LenZ, Name, Description and others… but the problem is: it automatically changes from cm to inch. And in the future I want to make this an automatic plugin with a shortcut and it’s not interesting to have to keep going through the attributes to modify the measurement unit.

Has anyone gone through this, and know the code? I’ve looked in several places and can’t find it.

Thanks!
(Google Translale)

Captura de tela 2023-08-03 185224