Exploit SketchUp file from/for Java application

588 views
Skip to first unread message

Xavier NOPRE

unread,
Dec 17, 2012, 5:07:48 PM12/17/12
to sketch...@googlegroups.com
Hi,

I know it's not the really good forum, but I need your help, I don't know where I can post my question ...

I'm developping a Java application, and I need to read SketchUp files to extract some data like volumes, areas, etc ...

How can I do ? Can I read SketchUp file from Java application ? Can I launch a script (Ruby script ?) that can read and exploit the SketchUp file ? Other idea ?

Thank you for your help !

Xavier

Rich Morin

unread,
Dec 17, 2012, 7:03:12 PM12/17/12
to sketch...@googlegroups.com
On Dec 17, 2012, at 14:07, Xavier NOPRE wrote:
> I know it's not the really good forum, but I need your help,
> I don't know where I can post my question ...

The SketchUcation Developer forum is a very good resource.


> I'm developing a Java application, and I need to read SketchUp
> files to extract some data like volumes, areas, etc ...

There are basically two ways to approach this:

* Write a Ruby plugin that exports the desired data in some
desired format (eg, JSON, XML, YAML). This is an easy path,
but (by default) it requires you to run SketchUp (and the
plugin) interactively. SketchUp _can_ be run in batch mode,
but that adds another layer of complexity.

* Use the provided SDK libraries to read SketchUp files from a
C++ application. This can get a bit complicated, but it is
almost guaranteed to have better performance.

-r

--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


Xavier NOPRE

unread,
Dec 18, 2012, 2:34:08 AM12/18/12
to sketch...@googlegroups.com
Hi Rich,

Thank you for your answer !!!

This 2 solutions can be good for me. The solution with Ruby plugin should be a good way to learn Ruby ;-), but I have some other questions :
  • The SDK is announced for Windows or Mac : is there a solution for Linux ?
  • With this SDK, is it possible to extract areas and volume (for a house) ? Or do I have to calculate it myself ? In this case, can I Found some examples ?
  • For the "Ruby script solution", for example, can I run Sketchup in batch mode, working on a specified SketchUp file, and activating my plugin ?
  • Same question as above for areas and volume : is it possible with Ruby API or do I have to do it myself ? 
  • Where can I find some examples ?
Thanks a lot for your help,

Xavier




2012/12/18 Rich Morin <r...@cfcl.com>


--
You received this message because you are subscribed to the Google Groups "SketchUp Ruby API" group.
To post to this group, send email to sketch...@googlegroups.com.
To unsubscribe from this group, send email to sketchupruby...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sketchupruby?hl=en.


Rich Morin

unread,
Dec 18, 2012, 8:24:19 AM12/18/12
to sketch...@googlegroups.com
On Dec 17, 2012, at 23:34, Xavier NOPRE wrote:
> * The SDK is announced for Windows or Mac:
> is there a solution for Linux?

I don't know for sure (I have no actual experience with the
SDK), but my suspicion is that a C++ library should be usable
on any OS. My suggestion is to download it and take a look.


> * With this SDK, is it possible to extract areas and volume
> (for a house)? Or do I have to calculate it myself? In this
> case, can I Found some examples?
> * Same question as above for areas and volume: is it
> possible with Ruby API or do I have to do it myself?

The Ruby API can calculate areas of individual faces, but I
don't believe this information is stored in the model. Any
higher-level aggregation (eg, volume for a house) would have
to be calculated, based on domain knowledge (eg, architecture).


> * For the "Ruby script solution", for example, can I run
> SketchUp in batch mode, working on a specified SketchUp
> file, and activating my plugin?

Yes, but it's a bit tricky. This page may be helpful:

http://wiki.cfcl.com/bin/view/SketchUp/Cookbook/BO_PM

> * Where can I find some examples ?

You might look around on the assorted plugin archives, eg:

Ruby Library Depot
http://rhin.crai.archi.fr/rld

ScriptSpot
http://www.scriptspot.com/sketchup

Smustard
http://www.smustard.com/

Eduardo Rodriguez

unread,
Dec 18, 2012, 2:42:35 PM12/18/12
to sketch...@googlegroups.com
I try to learn ruby sintax and i install a program name sublime text 2 its a program for wrote several programing lenguage you can change java to ruby  i hope i can help you.


2012/12/18 Rich Morin <r...@cfcl.com>
--
You received this message because you are subscribed to the Google Groups "SketchUp Ruby API" group.
To post to this group, send email to sketch...@googlegroups.com.
To unsubscribe from this group, send email to sketchupruby...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sketchupruby?hl=en.




--
Eduardo Rodriguez Guevara

maryam ramzi

unread,
Feb 2, 2016, 12:27:36 PM2/2/16
to SketchUp Ruby API
There are basically two ways to approach this:
  *  Use the provided SDK libraries to read SketchUp files from a
     C++ application.  This can get a bit complicated, but it is
     almost guaranteed to have better performance.

Is it possible to use this SDK in a Java or c# application or just in C++ application ? or is it possible to use a C++ application that will get the information from a sketchup model (area ... ) and use it in a java application ?

Jay Rosenberg

unread,
Feb 2, 2016, 12:35:01 PM2/2/16
to sketch...@googlegroups.com
There should be an omni platform that allows access to the objects/ key data variable (Data dictionary). So please copy me on this also
tnx in advance

--
You received this message because you are subscribed to the Google Groups "SketchUp Ruby API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sketchupruby...@googlegroups.com.

To post to this group, send email to sketch...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages