Our Gift to You: 20% off your own designs in Strong & Flexible Plastic through Dec 23, with promo code MY2014 · details
Home » Developers » Shapeways API » trying to upload stl model with python
Search Search  
trying to upload stl model with python [message #30701] Tue, 12 July 2011 13:39 UTC Go to previous message
avatar wzesk  is currently offline wzesk
Messages: 2
Registered: August 2009
Go to all my models
Junior Member
Below is my attempt. Does anyone have an example of how to format a .stl into an array[byte]?

 def submit(self):
        if self.session_id:
            model = self.assembly.SWModel()
            model.title = "test"
            model.desc = "test"
            model.modeltype = "STL"
            model.file = (base64.b64encode(open("test.stl").read()))
            model.filename = "test"
            model.tags = "test"
            model.has_color = 0
            model.scale = 1.0
            model.markup = 1.0
            loaded = self.shapelink.submitModel(self.session_id,model,"", self.application_id)
            return loaded

[Updated on: Tue, 12 July 2011 13:41 UTC]

Read Message
Read Message
Read Message
Previous Topic:Drop Shipping Can we get?
Next Topic:Other APIs planned?
Goto Forum:



We're sorry to inform you that we no longer support this browser and can't confirm that everything will work as expected. For the best Shapeways experience, please use one of the following browsers:

Click anywhere outside this window to continue.