<?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%2FExchange_materials</id>
	<title>OpenSite/Guides/Exchange materials - 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%2FExchange_materials"/>
	<link rel="alternate" type="text/html" href="https://kfdani-001-site10.gtempurl.com/index.php?title=OpenSite/Guides/Exchange_materials&amp;action=history"/>
	<updated>2026-10-30T02:06:20Z</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/Exchange_materials&amp;diff=862&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/Exchange_materials&amp;diff=862&amp;oldid=prev"/>
		<updated>2026-10-29T21:00:59Z</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.exchange-materials&lt;br /&gt;
|summary=Export a material set and import it into another document.&lt;br /&gt;
|prerequisites=Two practice documents and the material API. This lesson uses an in-memory exchange string rather than overwriting a file.&lt;br /&gt;
|steps==== Build the source material set ===&lt;br /&gt;
Create a user-defined material with explicit SI inputs.&lt;br /&gt;
&lt;br /&gt;
=== Export and identify the format ===&lt;br /&gt;
&amp;lt;code&amp;gt;material_export&amp;lt;/code&amp;gt; returns text containing &amp;lt;code&amp;gt;opensite-material-exchange&amp;lt;/code&amp;gt;. This is a material exchange payload, not the full &amp;lt;code&amp;gt;opensite-document&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Import into a fresh document ===&lt;br /&gt;
Pass the exported text to &amp;lt;code&amp;gt;material_import&amp;lt;/code&amp;gt; with the destination handle.&lt;br /&gt;
&lt;br /&gt;
=== Verify the imported properties ===&lt;br /&gt;
List the destination materials and read the imported object’s elastic modulus. Check values, not equality of source/destination object IDs.&lt;br /&gt;
&lt;br /&gt;
|result=The destination has one material and its elastic modulus is 210 GPa.&lt;br /&gt;
|limitations=Exchange does not copy geometry, undo history or the entire model. Do not assume identity values or numbering are portable between documents.&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;
source = 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;
opensite.material_create_user(source, values)&lt;br /&gt;
payload = opensite.material_export(source)[&amp;quot;text&amp;quot;]&lt;br /&gt;
assert &amp;quot;opensite-material-exchange&amp;quot; in payload&lt;br /&gt;
destination = opensite.execute(&amp;quot;document.new&amp;quot;, {})[&amp;quot;document&amp;quot;]&lt;br /&gt;
opensite.material_import(destination, payload)&lt;br /&gt;
rows = opensite.material_list(destination)&lt;br /&gt;
assert len(rows) == 1&lt;br /&gt;
item = destination.get_object(rows[0][&amp;quot;id&amp;quot;])&lt;br /&gt;
assert abs(item.elastic_modulus.si_value - 210e9) &amp;lt; 1.0&lt;br /&gt;
print(&amp;quot;Imported materials:&amp;quot;, len(rows))&lt;br /&gt;
# This is a material exchange, not a copy of the whole source document.&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/Edit duplicate and renumber materials|OpenSite/Guides/Native property formulas|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>