• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Loading skp model

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 2 Posters 821 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    MaryamR
    last edited by 4 Feb 2016, 22:42

    hello everyone,

    did anyone ever tested the example code from the sketchup official website, The example that demonstrates how to load a SketchUp model from a .SKP file and read some data from it.

    i was testing it but the model wasn't loaded.

    SUModelRef model = SU_INVALID;
    SUResult res = SUModelCreateFromFile(&model, "test.skp");
    // It's best to always check the return code from each SU function call.
    // Only showing this check once to keep this example short.
    if (res != SU_ERROR_NONE)
    std::cout << "error " << res <<"ok";
    // return 1;

    and when i tried to display the "res" variable it showed the number 7.

    what did i did wrong ?

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 5 Feb 2016, 10:12

      You probably want to make sure you have a full path instead of a relative path. With relative it's going to look for the file in the current working directory.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • M Offline
        MaryamR
        last edited by 5 Feb 2016, 10:56

        yes that how i solved it full path and the number 7 that was displayed reffers to :

        SU_ERROR_SERIALIZATION if an error occurs during reading of the file

        thnx ^^

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        1 / 1
        • First post
          1/3
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement