sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    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

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

        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

          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

            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
            • TIGT Offline
              TIG Moderator
              last edited by

              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

                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
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  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

                    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
                    • Dan RathbunD Offline
                      Dan Rathbun
                      last edited by

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

                      Advertisement