Questions tagged [solidworks]

SolidWorks is a 3D mechanical CAD (computer-aided design) program that runs on Microsoft Windows. SolidWorks has a COM-based API allowing users to automate its functions with VBA MACROS, VSTA MACROS (VB.NET/C#) and Add-ins (C#/VB.NET/C++).

319 questions
4
votes
2 answers

Open .dwg Using SolidWorks API

I am trying to open a .dwg file in SolidWorks 2015. I have been succsesfully able to open a .slddrw by using IModelDoc2 doc = swApp.OpenDoc6("C:/Temp/BlankDraw.SLDDRW", (int)swDocumentTypes_e.swDocDRAWING,…
Cogorlopez
  • 63
  • 1
  • 8
4
votes
1 answer

Execute SolidWorks in background and exit with VBA macro

I am trying to do a complex geometry using SolidWorks and a VBA macro that I launch it with a batch script. Firstly I did a simple macro to check if it is possible to run solidworks in background, creating a new part, doing a simple cube and then…
Lifehaxor
  • 73
  • 4
4
votes
6 answers

Importing AutoCAD/Solidworks drawings/objects into winforms?

Has anybody done anything like that? I need to import 3d objects, done in either AutoCAD or Solidworks, and draw them into a windows form. I only need the object to be viewed in 3D and moved around - no manipulation required. I am assuming I will…
Pudpuduk
  • 1,339
  • 1
  • 12
  • 23
4
votes
2 answers

What's the main difference between B-Rep and Mesh index represation

I know B-Rep (ParaSolid) is the popular solid representation. From my past experience, I always touch the triangle mesh representation like OBJ, STL file format. I am wondering why B-Rep is better than mesh representation? What's the main…
Adam Lee
  • 21,598
  • 43
  • 138
  • 208
3
votes
0 answers

Combine 2 pdfs in one using VBA

I'm currently working on a macro that creates a PDF from a SolidWorks file and then, if the Solidworks File is an assembly, it would merge the pdf with its BOM. The problem is that I've coded the merge part of the macro, but I keep getting a "False"…
3
votes
1 answer

creating 2d image sprite from 3d solidworks model

Im looking to replicate what is done on the remix 3d site images found here: https://www.remix3d.com/board/3vkCqsxjqeH for each item they've created an Image Sprite (example sprite from Remix 3D). The sprite is sequential snapshots of an object in…
hammertime
  • 93
  • 5
3
votes
1 answer

"Not responding" during the execution of function from COM object

It's been several days that I'm on this problem without finding a solution... I developed a macro for SolidWorks in VB.NET. It uses a COM object from a DLL that I developed in C++. The functions of this COM object take a long time to run (sometimes…
nigavevoli
  • 31
  • 5
3
votes
2 answers

Connecting CAD model (Solidworks, AutoCAD or CATIA) with realtime measurements from Raspbery Pi or Arduino Sensor

To present my question I will simplify my example. I will connect a sprocket on a step motor and measure acceleration with an accelerometer. The data will be captured by using either an Arduino or Raspberry pi sensor setup. The measurements will…
tony rox
  • 37
  • 3
3
votes
1 answer

Solidworks VBA skip empty array

I'm creating a macro for rendering solidworks models. It is meant to render all configurations in an assembly. A piece of code I'm working on has to extract the mass of all configurations and place it at the end of the rendername. For most…
3
votes
3 answers

SolidWorks EPDM GetVar for BoM not working in VBA

This one has me really stymied and I suspect it because I am now too "close" to the problem. I am converting a VB.NET routine into a VBA routine. Here is the VB.NET code that works as expected.` Dim rows() As Object BOM.GetRows(rows) …
CodeWriter
  • 51
  • 10
3
votes
1 answer

Solidworks Property Manager Page - 2 buttons on same line

I'm building my own Solidworks Addin and while building it, I encountered a difficulty. Anybody knows how to Create 2 buttons side-by-side in a Property Manager Page? I tried the different possibilities of the …
3
votes
1 answer

Building a C# addin for Solidworks

It seems quite complicated on multiple sites. What are the proper steps to build a Solidworks Addin in C# with Visual Studio 2017?
3
votes
1 answer

Problems with EquationMgr & SelectionManger Solidworks Api C#

I'm trying to understand principles of solidworks API, but have several problems. Here is my code: for (var i = 0; i < selMgr.GetSelectedObjectCount(); i++) { var Face = selMgr.GetSelectedObject(i+1); …
being of habits
  • 187
  • 1
  • 10
3
votes
1 answer

How to refer to a relative path in SolidWorks VBA

I am writing a macro in SolidWorks VBA that is supposed to open all the parts of an assembly and update their design tables. When the assembly and parts are copied to a new location, I want the macro to open the new (copied) parts in their new…
user9551155
3
votes
3 answers

Some extrusions in loop in solidworks VBA don't work

I am attempting to run a loop of extrusions in solidworks API using VBA. The height of each extrusion is determined by the brightness of the pixels in a bitmap. For the most part the code works as expected however about a quarter of the extrusions…
Nadav
  • 31
  • 2
1
2
3
21 22