Open SKP in VB.NET Application
-
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
-
Have you looked at the exampled in the SDK package?
-
Yes I did, but it didn't help.
So I'm searchng the Internet. -
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.
-
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 -
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 Integergives 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? -
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
-
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...
-
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.
Advertisement