• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

Open SKP in VB.NET Application

Scheduled Pinned Locked Moved Developers' Forum
9 Posts 4 Posters 2.2k Views 4 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.
  • G Offline
    GerhardG
    last edited by 23 May 2011, 12:48

    Hi All

    I have to open a SKP file, get the mesh, use it for some mappings and save in my own file format inside my VB.NET application.

    All Code Snippets and help is not helpful for me.

    Who can help me?
    Where can I get some code snippets to see the main structure / functions etc for using the SketchUpReader.dll?

    Best regards

    Gerhard

    1 Reply Last reply Reply Quote 0
    • T Offline
      thomthom
      last edited by 23 May 2011, 13:05

      Have you looked at the exampled in the SDK package?

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

      1 Reply Last reply Reply Quote 0
      • G Offline
        GerhardG
        last edited by 23 May 2011, 13:06

        Yes I did, but it didn't help.
        So I'm searchng the Internet.

        1 Reply Last reply Reply Quote 0
        • G Offline
          GerhardG
          last edited by 23 May 2011, 13:15

          Yes, I did, but it didn't help.

          First step is to open a SKP fiel and show it. Later steps is to manipulate and save it.

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 23 May 2011, 13:37

            Isn't your basic stumbling block that the SUp SDK is entirely C oriented and you want to find some VB stuff when there's no help available that I know of ??
            You might look for a long time 😕

            TIG

            1 Reply Last reply Reply Quote 0
            • G Offline
              GerhardG
              last edited by 23 May 2011, 14:00

              I thought the dll is usable for VB and C++ and C# ...
              So the only difference is how to callt he functions, given by the dll.
              Am I wrong with this?

              looking at the example I see them using classname and function name.
              In other codelines I use
              Private Declare Function GetDesktopWindow Lib "user32.dll" () As IntPtr
              to get the function out of the dll. So I need a doc, which function I need for what and how to get them.

              using
              Private Declare Function skpOpenFile Lib "SketchUpReader.dll" Alias "OpenFile" (ByVal filePath As String, ByRef retVal As VariantType) As Integer

              gives me the error : entry point not found.
              using
              Private Declare Function skpOpenFile Lib "SketchUpReader.dll" Alias "ISkpFileReader.OpenFile" (ByVal filePath As String, ByRef retVal As VariantType) As Integer
              is the same.

              So, how Do I locate the function in the dll?
              How Do I include it in my code?

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 23 May 2011, 14:51

                That's what I'm saying - you may be able to access the dll with VB BUT it's documented/written specifically for C... AND there's scant help on that! let alone for the unsupported VB 😒

                TIG

                1 Reply Last reply Reply Quote 0
                • G Offline
                  GerhardG
                  last edited by 23 May 2011, 14:56

                  It's a big professional application with several years of development...
                  Is there any other way to get a workaround?
                  Write my own c++ dll, using the stuff and then use my c++ dll inside my VB application?

                  What a frustrating day...

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    Dan Rathbun
                    last edited by 23 May 2011, 23:12

                    If you look in the SDK folder (where "SDK" is whatever name you gave it,):

                    SDK\SkpWriter\Headers\source\sketchup\skpwriter\sapi

                    and the specific file: applicationfactory.h

                    you will see the following source line that declares an exported DLL function:

                    %(#4040BF)[extern _declspec(dllexport) IApplication* GetApplication();]

                    I believe you must first get a handle to the Sketchup Application Interface, by calling %(#4040BF)[GetApplication()]... then you can call that object's methods, such as getting the handle on the current document, or creating a new document (meaning a SKP model file.)

                    All of the API classes and methods are listed in the "documentation" folders, but be sure to reference both of them. (There is a "documentation" folder under both the "SKPWriter" and "SKPReader" folders.) The files are html, and can be opened locally with your browser. (Click the "index.html" file to start off.)
                    There are a few simple examples in the help docs for SKPReader.

                    There are also a couple of VS project examples under the "Examples" folders.

                    I'm not here much anymore.

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

                    Advertisement