返回或设置文档的单位系统。详情请参考 Rhino 帮助文档中关于 文档属性 的部分。
rhinoscriptsyntax.UnitSystem (unit_system=None, scale=False, in_model_units=True)
rhinoscript.document.UnitSystem (unit_system=None, scale=False, in_model_units=True)
unit_system |
可选参数。数字。单位系统。有效的单位系统如下:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
scale |
可选参数。布尔值。用新的单位系统缩放现有的几何体。如果没有指定,不会缩放任何现有的几何体(False)。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
in_model_units |
可选参数。布尔值。返回或修改文档的模型单位(True)或文档的页面单位(False)。默认值为 True 。 |
数字 |
如果没有指定 unit_system 参数,返回当前的单位系统。 |
数字 |
如果指定了 unit_system 参数,返回先前的单位系统。 |
None |
如果执行不成功或出错,返回空值。 |
import rhinoscriptsyntax as rs
rhUnitMillimeters = 2
rhUnitInches = 8
current_system = rs.UnitSystem()
if current_system==rhUnitMillimeters:
rs.UnitSystem(rhUnitInches, True)