<?xml version="1.0" encoding="ISO-8859-15"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="http://www.shapeways.com/forum/index.php">
  <title>Shapeways: Bring your creativity to life in 3D</title>
  <link>http://www.shapeways.com/forum/index.php</link>
  <description>Shapeways: Bring your creativity to life in 3D</description>
  <items>
    <rdf:Seq>
			<rdf:li rdf:resource="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30701&amp;th=5794#msg_30701" />
			<rdf:li rdf:resource="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30825&amp;th=5794#msg_30825" />
			<rdf:li rdf:resource="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=35545&amp;th=5794#msg_35545" />
		</rdf:Seq>
	</items>
</channel>

<item rdf:about="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30701&amp;th=5794#msg_30701">
  <title>trying to upload stl model with python</title>
  <link>http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30701&amp;th=5794#msg_30701</link>
  <description><![CDATA[Below is my attempt.  Does anyone have an example of how to format a .stl into an array&#91;byte&#93;?<br />
<br />
<div class="pre"><pre>   
 def submit(self):
        if self.session_id:
            model = self.assembly.SWModel()
            model.title = &quot;test&quot;
            model.desc = &quot;test&quot;
            model.modeltype = &quot;STL&quot;
            model.file = (base64.b64encode(open(&quot;test.stl&quot;).read()))
            model.filename = &quot;test&quot;
            model.tags = &quot;test&quot;
            model.has_color = 0
            model.scale = 1.0
            model.markup = 1.0
            loaded = self.shapelink.submitModel(self.session_id,model,&quot;&quot;, self.application_id)
            return loaded
</pre></div>]]></description>
  <dc:subject></dc:subject>
  <dc:creator>wzesk</dc:creator>
  <dc:date>2011-07-12T13:39:36-00:00</dc:date>
</item>

<item rdf:about="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30825&amp;th=5794#msg_30825">
  <title>Re: trying to upload stl model with python</title>
  <link>http://www.shapeways.com/forum/index.php?t=rview&amp;goto=30825&amp;th=5794#msg_30825</link>
  <description><![CDATA[got it working.  <br />
<br />
Here is the solution I used :<br />
<div class="pre"><pre>
model.file = tuple(bytearray((open(&quot;test.stl&quot;).read()),&quot;base64&quot;))
</pre></div>]]></description>
  <dc:subject></dc:subject>
  <dc:creator>wzesk</dc:creator>
  <dc:date>2011-07-13T22:44:39-00:00</dc:date>
</item>

<item rdf:about="http://www.shapeways.com/forum/index.php?t=rview&amp;goto=35545&amp;th=5794#msg_35545">
  <title>Re: trying to upload stl model with python</title>
  <link>http://www.shapeways.com/forum/index.php?t=rview&amp;goto=35545&amp;th=5794#msg_35545</link>
  <description><![CDATA[you need to specify 'rb' in your open method to specify to treat the file as binary.]]></description>
  <dc:subject></dc:subject>
  <dc:creator>lancepickens</dc:creator>
  <dc:date>2011-09-30T20:09:06-00:00</dc:date>
</item>
</rdf:RDF>