<?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%2FCreate_a_material</id>
	<title>OpenSite/Guides/Create a material - 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%2FCreate_a_material"/>
	<link rel="alternate" type="text/html" href="https://kfdani-001-site10.gtempurl.com/index.php?title=OpenSite/Guides/Create_a_material&amp;action=history"/>
	<updated>2026-10-30T02:07:04Z</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/Create_a_material&amp;diff=860&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/Create_a_material&amp;diff=860&amp;oldid=prev"/>
		<updated>2026-10-29T21:00:56Z</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.create-a-material&lt;br /&gt;
|summary=Create a user-defined practice material and read its properties through the document object interface.&lt;br /&gt;
|prerequisites=A matching build with the material API. User-material operations use &amp;lt;code&amp;gt;document.workspace&amp;lt;/code&amp;gt;; the catalog-provider registration capability is a separate concern.&lt;br /&gt;
|steps==== Start with a new document ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;document.new&amp;lt;/code&amp;gt; to obtain a live document handle. In the desktop, the material extension exposes Add Material and Material Manager when available.&lt;br /&gt;
&lt;br /&gt;
=== Enter the practice values ===&lt;br /&gt;
Use E = 210 GPa, ν = 0.28 and density = 7850 kg/m³. The helper takes SI values: &amp;lt;code&amp;gt;elastic_pa=210e9&amp;lt;/code&amp;gt;, not 210. The values are educational inputs, not an approved standard grade.&lt;br /&gt;
&lt;br /&gt;
=== Create and validate ===&lt;br /&gt;
Call &amp;lt;code&amp;gt;material_create_user&amp;lt;/code&amp;gt;, retain the returned object ID, and call &amp;lt;code&amp;gt;material_validate&amp;lt;/code&amp;gt;. Validation concerns the material record; it does not approve a design.&lt;br /&gt;
&lt;br /&gt;
=== Read the object and check shear modulus ===&lt;br /&gt;
Resolve the object using &amp;lt;code&amp;gt;doc.get_object(id)&amp;lt;/code&amp;gt;. Read E in GPa and compare G with E / (2 × (1 + ν)); expected G is 82.03125 GPa.&lt;br /&gt;
&lt;br /&gt;
|result=The created object exposes E = 210 GPa. The listed derived shear modulus is approximately 82.03125 GPa and the validation result is reported.&lt;br /&gt;
|limitations=No production catalog grade or design-standard compliance is claimed. Save the document separately if you want to retain the new material.&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;
doc = opensite.execute(&amp;quot;document.new&amp;quot;, {})[&amp;quot;document&amp;quot;]&lt;br /&gt;
values = {&lt;br /&gt;
    &amp;quot;name&amp;quot;: &amp;quot;Practice steel&amp;quot;, &amp;quot;family&amp;quot;: &amp;quot;steel&amp;quot;, &amp;quot;role&amp;quot;: &amp;quot;structural_steel&amp;quot;,&lt;br /&gt;
    &amp;quot;has_elastic&amp;quot;: True, &amp;quot;elastic_pa&amp;quot;: 210.0e9,&lt;br /&gt;
    &amp;quot;has_poisson&amp;quot;: True, &amp;quot;poisson&amp;quot;: 0.28,&lt;br /&gt;
    &amp;quot;has_mass_density&amp;quot;: True, &amp;quot;mass_density&amp;quot;: 7850.0,&lt;br /&gt;
    &amp;quot;has_thermal&amp;quot;: True, &amp;quot;thermal_per_k&amp;quot;: 1.2e-5,&lt;br /&gt;
}&lt;br /&gt;
created = opensite.material_create_user(doc, values)&lt;br /&gt;
material = doc.get_object(created[&amp;quot;id&amp;quot;])&lt;br /&gt;
print(&amp;quot;Name:&amp;quot;, material.name)&lt;br /&gt;
print(&amp;quot;Elastic modulus:&amp;quot;, material.elastic_modulus.value_in(&amp;quot;GPa&amp;quot;), &amp;quot;GPa&amp;quot;)&lt;br /&gt;
print(&amp;quot;Validation:&amp;quot;, opensite.material_validate(doc, created[&amp;quot;id&amp;quot;])[&amp;quot;validation&amp;quot;])&lt;br /&gt;
row = next(m for m in opensite.material_list(doc) if m[&amp;quot;id&amp;quot;] == created[&amp;quot;id&amp;quot;])&lt;br /&gt;
expected_g = 210.0e9 / (2.0 * (1.0 + 0.28))&lt;br /&gt;
assert abs(row[&amp;quot;shear_modulus_pa&amp;quot;] - expected_g) &amp;lt; 1.0&lt;br /&gt;
print(&amp;quot;Derived shear modulus:&amp;quot;, row[&amp;quot;shear_modulus_pa&amp;quot;] / 1e9, &amp;quot;GPa&amp;quot;)&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/Quantities and profiles|OpenSite/Guides/Edit duplicate and renumber materials|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>