sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Loading skp model

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 837 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

      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
      • thomthomT Offline
        thomthom
        last edited by

        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

          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
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement