i’m exploring the possibilities given by Sketchup
Ruby API,and i found the “attrreporter.rb” file but it only generates csv and html files and only from groups or components.
I have a question is it possible to generate a Word or PDF documents that contains information extracted from Sketchup models ?
and those the model has to contain groups and components to do so ?
The SketchUp API doesn’t come with any methods by itself to generate these specific files. But you can certainly traverse the model, collect the info you need and generate these files yourself - using libraries that allows you to do so.
in the attrreport.rb file it generates csv and html files but they say :
# Currently we support CSV and HTML.
# More format can be easily defined here by defining the @filetype expected and the
# various variables @doc_start, @doc_end, @row_start, @row_end, @cell_start, @cell_mid, and @cell_end
how can i know the values to give t those variables ?
i kept searching but didn’t found anything about it ?
can u give an example of libraries that allows me to generate Word/PDF files ?
i didn’t try that by i tried to change the .csv to .pfd in code i found in the link above, it generates a pdf file but when i want to open it it says that the doc wasn’t decoded correctly.
i guess it has something to do with the # various variables @doc_start, @doc_end, @row_start, @row_end, @cell_start, @cell_mid, and @cell_end
because in that code they say if u want other file forma change those variables.
yeah it workd with the htm method but it generates a htm and i need to open it with Microsoft Word, isn’t there a possibility to generate a Word file directly ?
i found a library named Prawn http://prawnpdf.org/api-docs/2.0/
do u have an idea about it ? how can i integrate those kind of libraries to sketchup ruby API ?