ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CSChris Szlatenyi25/01/2013

Hi all, I've been working on a macro to aid high school kids with the design of a remotely operated underwater vehicle. I figure I will share here if anyone is interested and maybe get some feedback. Also included is a little test assembly I've been using.

First off, a warning: I have zero programming experience and this is as much an exercise in learning c#, solidworks api as it is to create something useful, so my apologies for what I'm sure is sloppy inefficient code.

What it does:

--Inserts a new 3DSketch "CG" with a point at the center of gravity

--Calculates Center of Volume and inserts a new 3DSketch "CB" with a point at the center of buoyancy.

--Returns:

----Mass, Center of Mass

----Volume, Center of Buoyancy

----Air Weight, Water Weight, % Buoyancy

----Stable Pitch (about z) and Roll (about x) Angles

Notes:

File must be an assembly

It excludes hidden and suppressed components

Uses system units (MKS)

The center of buoyancy calc is probably the most useful thing here. I can upload a macro that is just that if anyone is interested.

In the future, I'd like to transition this to an add-in application and maybe somehow incorporate some motion simulation with thrusters. Thanks for taking a look!

Chris