Thread: Reading Google Sketchup (.skp) or Google Earth (.kmz)

  1. #1
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226

    Reading Google Sketchup (.skp) or Google Earth (.kmz)

    Hi,

    I need to write a simple c++ application the reads sketchup (skp) or google earth file (kmz) and get out of them the mesh information. Can somebody provide me with suitable links?

    Is there any C library available for doing this?

    Thanks a lot in advance.

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    There is a C++ SDK you can get from Google for SketchUp (Pro only) by signing a non-disclosure agreement.

    Also, there is a Ruby language API from which you can extract the mesh information. (Pro or Free)

    Not sure about KMZ, but I think it's just an XML file. Google documents it on their API website.

    Todd
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Todd Burch View Post
    Not sure about KMZ, but I think it's just an XML file. Google documents it on their API website.
    I'm fairly sure it's a compressed (zipped/gzipped) XML file.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226
    >> Also, there is a Ruby language API from which you can extract the mesh information. (Pro or Free)

    Can you please provide me with a link to this API?

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Quote Originally Posted by Zeeshan View Post
    >> Also, there is a Ruby language API from which you can extract the mesh information. (Pro or Free)

    Can you please provide me with a link to this API?
    After you download and install SketchUp, go to Help -> Ruby Help. It lists the class and the methods you need to know.

    Todd
    Mainframe assembler programmer by trade. C coder when I can.

  7. #7
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226

    Reading Sketchup files in Linux

    Thanks a whole lot for your response.

    Is there any way to read Sketchup files, while in Linux...I want to develop my own C++ API to do this? (I don't have Sketchup Pro so no access to Google's C++ SDK).

    Any ideas as to where I should start?

    Thanks.

  8. #8
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Sketchup doesn't officially run on Linux, but a group a avid Linux'ers have got it working under Whine. To read the file directly, you need the SDK. You can export from Sketchup to 3DS or FBX and probably work with those file formats under Linux, but, again, you need the Pro version to export to these formats, so again, you are hosed.

    If you NEED it, then you NEED it, then spring for the $495 and get it.

    Todd
    Mainframe assembler programmer by trade. C coder when I can.

  9. #9
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226
    Thanks Todd for your reply.

    But how about Ruby...Do you think the Sketchup Ruby API can be used outside of Sketchup? I guess Ruby can be run under Linux, right???

    So, if I can access this API without sketchup...I should be able to extract the 3D mesh info. from Linux ...right?

  10. #10
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I guess Ruby can be run under Linux, right???
    Yes.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  2. Nice vistas with the equivalent Google Earth version
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-14-2008, 06:58 AM
  3. Google Sketchup
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 11-13-2006, 05:18 PM