Extracting shapes form .rsdoc files

Need help, or want to share a macro? Post here!
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Extracting shapes form .rsdoc files

Postby shoogen » Thu May 15, 2014 9:35 am

I would like share that i found out a way to get geometry out of .rsdoc files.
Since DesignSpark mechanical won't let you safe anything but their native format (.rsdoc) and mesh formats the procedure is a bit cumbersome. (I needed MS Windows and DesignSpark mechanical to perform the important steps.)
1. retrieve the .rsdoc file
2. open the file as zip-archive and extract every .sab (ACIS binary) files.
3. next you need to convert the .sab to a .sat (ACIS text) file. If you got DesignSpark mechanical installed you can use the program "SabSatConverter.exe" to do that.
4. next you need to convert the .sat file to a .brep or .step file. I used the evaluation version of the CAD Exchanger by Roman Lygin (http://www.cadexchanger.com)
5. open the .brep or .step files in FreeCAD ;)

I don't want to encourage anyone in using propitiatory software.
But I get annoyed easily, when people tell me they want to modify a stl file from thingiverse, and i can tell from the screenshot, that the original author used a software that allows exporting STEP files.
Please avoid using meshes whenever you can.
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extracting shapes form .rsdoc files

Postby shoogen » Thu May 22, 2014 8:22 am

This works fine for simple objects. But i ran into problems for complex assemblies. In those shapes are used multiple times.
I tried to extract this information form the document.xml but I'm still missing a link.
the "source" tag has an attribute "RefId". The value consists of a UUID, a colon and an integer (eg. "29639092-6919-4977-a78e-74d53c30d311:22".) The Ids for tags in the document consist of two integers separated by a colon (eg. "0:2" for the root part).
In simple documents there are often few elements with unique values (for the latter part of the Id). Then i can guess the right association. But this does not work complex assemblies like the "c't Hacks" woodmill https://github.com/heise/WOODMILL/
Is there anyone out there with experience in XML file formats and the Open Packaging Conventions (ISO/IEC 29500-2)?
jimmywu
Posts: 8
Joined: Sun Dec 29, 2013 12:51 pm

Re: Extracting shapes form .rsdoc files

Postby jimmywu » Mon Jul 07, 2014 12:47 pm

Please tell me how to
1. retrieve the .rsdoc file
2. open the file as zip-archive and extract every .sab (ACIS binary) files.
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extracting shapes form .rsdoc files

Postby shoogen » Mon Jul 07, 2014 6:56 pm

1. you either save it or you download it.
2. some programs like 7z allow you to open the file as an zip archive right away. Other tools require the file to be renamed to .zip.
The sab files are located in the SpaceClaim/Geometry/ subdirectory.
If created a python script which can do the extraction and do the conversion from sab two sat using wine and DesignSpark mech..
https://gist.github.com/5263/997617e8e3 ... doc-py-L40
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extracting shapes form .rsdoc files

Postby NormandC » Tue Jul 08, 2014 3:43 am

shoogen wrote:do the conversion from sab two sat using wine and DesignSpark mech..
Out of curiosity, did you mean you were able to get a functional DesignSpark Mechanical in Linux using Wine? Or only the "SabSatConverter.exe" utility? Wine's AppDB rates DesignSpark Mech as garbage.
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extracting shapes form .rsdoc files

Postby shoogen » Tue Jul 08, 2014 7:00 am

normandc wrote:Out of curiosity, did you mean you were able to get a functional DesignSpark Mechanical in Linux using Wine? Or only the "SabSatConverter.exe" utility?
I'm calling SabSatConverter. I wanted to emphasize that you need to have Design Spark Mechanical installed.
jimmywu
Posts: 8
Joined: Sun Dec 29, 2013 12:51 pm

Re: Extracting shapes form .rsdoc files

Postby jimmywu » Tue Jul 08, 2014 2:46 pm

Thank you!!
Python script Now would not use
ideapc
Posts: 5
Joined: Sun Jul 13, 2014 5:10 pm

Re: Extracting shapes form .rsdoc files

Postby ideapc » Sun Jul 13, 2014 5:20 pm

Hello, how use you the utility " sabsatconverter "?
I extracted the files " sab " of the file " rsdoc " but I do not manage to launch the utility " sabsatconverter. :(
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extracting shapes form .rsdoc files

Postby shoogen » Sun Jul 13, 2014 6:07 pm

Code: Select all

sabSatConverter.exe -i input.sab -o output.sat
ideapc
Posts: 5
Joined: Sun Jul 13, 2014 5:10 pm

Re: Extracting shapes form .rsdoc files

Postby ideapc » Sun Jul 13, 2014 6:33 pm

When I click on the utility " sabsatconverter " situated in "DesignSpark" there is nothing if it is not a window of line of command that disparait immediately.
Can detail me to you the procedure.
Thank you for your help.