You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Layout interactive UI, dimensions can be configured for the unit system:
at document level
at dimension level
In the Layout API, there are several problems:
At Dimension level: the unit system of the LinearDimension can be obtained via its style with the method: LinearDimension#style.dimension_units. However there is no way to SET the unit, because there is no setter method LinearDimension#style.dimension_units=
At Document level, there is are getter and setter methods to get the unit system of the Document: Document: Document.unit and Document.precision. HOWEVER, it seems that there are limitations in the unit system you can set in the document, probably based on the template used. For instance, I can only set the unit in Decimal or in Fractional, but NOT in Engineering and Architectural. I get an API error otherwise. This seems to be a limitation in the interactive UI too.
In the Imperial systems (Architectural and Fractional), there is an option to use or not an hyphen between after the first number (ex: 3'-2 2/4" or 4-3/4"). This option exists in the interactive UI at Dimension level:
This setting is absent from the API, whether at Document level (in get and set) or at Dimension level (get).
It would be ueful to have a complete and consistent set of methods to get and set the unit system in the API, at least at the same level as the interactive UI.
The text was updated successfully, but these errors were encountered:
There is a setter method for dimension unit in the Style class, called set_dimension_units (and not dimension_units=).
There remain the question of the hyphen, which is less an issue, as it is not even supported in Sketchup. It seems to have been added lately, and the API was not updated.
For the Document units, I still do not understand why there is a limitation to Decimal and Fractional. The fact is that the unit system set at Document level are used as the default for all dimensions, except if they have their own unit system specified via their style.
In the Layout interactive UI, dimensions can be configured for the unit system:
In the Layout API, there are several problems:
At Dimension level: the unit system of the
LinearDimension
can be obtained via its style with the method:LinearDimension#style.dimension_units
. However there is no way to SET the unit, because there is no setter methodLinearDimension#style.dimension_units=
At Document level, there is are getter and setter methods to get the unit system of the Document:

Document: Document.unit
andDocument.precision
. HOWEVER, it seems that there are limitations in the unit system you can set in the document, probably based on the template used. For instance, I can only set the unit in Decimal or in Fractional, but NOT in Engineering and Architectural. I get an API error otherwise. This seems to be a limitation in the interactive UI too.In the Imperial systems (Architectural and Fractional), there is an option to use or not an hyphen between after the first number (ex: 3'-2 2/4" or 4-3/4"). This option exists in the interactive UI at Dimension level:
This setting is absent from the API, whether at Document level (in get and set) or at Dimension level (get).
It would be ueful to have a complete and consistent set of methods to get and set the unit system in the API, at least at the same level as the interactive UI.
The text was updated successfully, but these errors were encountered: