I’m working on a piece of software using vb.net that should allow the user to open sketch up files '.skp' and perform some measure on it. Any ideas how to get vb.net to open SKP files?

Dani AI

Generated

As hinted, .skp is a proprietary SketchUp format and VB.NET cannot open it natively. There are two practical approaches: use the official SketchUp SDK to read .skp directly, or export the model to a neutral format (OBJ/DAE/JSON) and consume that in VB.NET. SketchUp does not expose a COM automation layer; scripting is done with the Ruby API or by using the native SDK. See the official docs for details: SketchUp developer site and SketchUp Ruby API docs.

Recommended paths, with tradeoffs:

  • Direct (best fidelity): use the SketchUp C/C++ SDK and write a thin native-to-managed bridge (C++/CLI) that loads the model, traverses entities, applies instance transforms, and exposes simple managed lists of vertices/edges/faces to VB.NET. Pros: full access to geometry/metadata. Cons: need native build, careful memory handling, match SDK ↔ SKP versions.
  • Indirect (fast to prototype): export from SketchUp to COLLADA/OBJ or create a small Ruby exporter that writes vertex/edge lists or JSON. Load that file in VB.NET (or with an existing .NET importer) and compute measurements. Pros: minimal native code and fastest to get results. Cons: may lose SketchUp-specific metadata.

When you have coordinates, measuring is straightforward. Example VB.NET distance function:

Function Distance(a() As Double, b() As Double) As Double
    Dim dx = a(0) - b(0)
    Dim dy = a(1) - b(1)
    Dim dz = a(2) - b(2)
    Return Math.Sqrt(dx*dx + dy*dy + dz*dz)
End Function

Troubleshooting notes: always apply group/component transforms before measuring; confirm model units and scale; check SDK version compatibility with the .skp file; read the SDK license and docs on the developer site. For a quick proof-of-concept, exporting to OBJ/JSON from SketchUp is the fastest; for production tooling or batch processing, invest in the SDK + managed wrapper.

Recommended Answers

All 2 Replies

Thanks a lot, it helped

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.