<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://kfdani-001-site10.gtempurl.com/index.php?action=history&amp;feed=atom&amp;title=OpenSite%2FGuides%2FQuantities_and_profiles</id>
	<title>OpenSite/Guides/Quantities and profiles - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://kfdani-001-site10.gtempurl.com/index.php?action=history&amp;feed=atom&amp;title=OpenSite%2FGuides%2FQuantities_and_profiles"/>
	<link rel="alternate" type="text/html" href="https://kfdani-001-site10.gtempurl.com/index.php?title=OpenSite/Guides/Quantities_and_profiles&amp;action=history"/>
	<updated>2026-10-30T02:06:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://kfdani-001-site10.gtempurl.com/index.php?title=OpenSite/Guides/Quantities_and_profiles&amp;diff=859&amp;oldid=prev</id>
		<title>BathAfrica: Add rewritten practical lesson with steps, code and expected results</title>
		<link rel="alternate" type="text/html" href="https://kfdani-001-site10.gtempurl.com/index.php?title=OpenSite/Guides/Quantities_and_profiles&amp;diff=859&amp;oldid=prev"/>
		<updated>2026-10-29T21:00:54Z</updated>

		<summary type="html">&lt;p&gt;Add rewritten practical lesson with steps, code and expected results&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
{{OpenSite scope}}&lt;br /&gt;
{{OpenSite lesson&lt;br /&gt;
|id=opensite.help.quantities-and-profiles&lt;br /&gt;
|summary=Add quantities written in different units and change their display profile without changing their physical values.&lt;br /&gt;
|prerequisites=Embedded OpenSite Python. This lesson does not require a document or a development authorization policy.&lt;br /&gt;
|steps==== Enter units explicitly ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;parse_quantity&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Q&amp;lt;/code&amp;gt; rather than assuming that 450 means millimetres. The example combines 3.2 m with 450 mm.&lt;br /&gt;
&lt;br /&gt;
=== Add compatible quantities ===&lt;br /&gt;
The units engine converts compatible lengths to canonical SI before adding them. Expected total: 3.65 m, or 3650 mm.&lt;br /&gt;
&lt;br /&gt;
=== Change presentation ===&lt;br /&gt;
Switch to &amp;lt;code&amp;gt;engineering_metric&amp;lt;/code&amp;gt; and format the same quantity. Store and compare its SI value before and after. Displaying millimetres must not scale the model.&lt;br /&gt;
&lt;br /&gt;
=== Handle a rejected unit ===&lt;br /&gt;
Check the unit spelling, physical dimension and quantity kind. Pressure is not a length; absolute temperature differs from a temperature difference.&lt;br /&gt;
&lt;br /&gt;
|result=The script prints 3650 mm. Its assertions confirm an SI total of 3.65 m and unchanged SI after selecting the display profile.&lt;br /&gt;
|limitations=Profiles affect presentation. They do not choose a national design standard. The script changes the current profile for this session; return to your preferred profile afterwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Complete example ==&lt;br /&gt;
{{Code|lang=python|code=&amp;lt;nowiki&amp;gt;import opensite&lt;br /&gt;
&lt;br /&gt;
span = opensite.parse_quantity(&amp;quot;3.2 m&amp;quot;)&lt;br /&gt;
extension = opensite.parse_quantity(&amp;quot;450 mm&amp;quot;)&lt;br /&gt;
total = opensite.add(span, extension)&lt;br /&gt;
print(f&amp;quot;Total: {total.value_in(&amp;#039;mm&amp;#039;):.0f} mm&amp;quot;)&lt;br /&gt;
assert abs(total.si_value - 3.65) &amp;lt; 1e-12&lt;br /&gt;
&lt;br /&gt;
before = total.si_value&lt;br /&gt;
opensite.execute(&amp;quot;units.set_profile&amp;quot;, {&amp;quot;profile&amp;quot;: &amp;quot;engineering_metric&amp;quot;})&lt;br /&gt;
print(&amp;quot;Display:&amp;quot;, opensite.format_quantity(total, &amp;quot;engineering_metric&amp;quot;))&lt;br /&gt;
assert total.si_value == before&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;os-page-nav&amp;quot;&amp;gt;{{Docnav|OpenSite/Guides/First document|OpenSite/Guides/Create a material|OpenSite/Guides|All guides}}&amp;lt;/div&amp;gt;&lt;br /&gt;
[[Category:OpenSite documentation]]&lt;/div&gt;</summary>
		<author><name>BathAfrica</name></author>
	</entry>
</feed>