Saturday, May 17, 2008

Motion Simulation in Solid Edge using sketches together with Microsoft Excel VBA Programming Part I

Solid Edge has a very useful application called "Motion" which allows a user to simulate the movement of mechanical parts. This enables the machine designers to test and make sure that the movement of their mechanism is the same as they expect before manufacturing parts. This helps save a lot of money.

However, instead of using "Motion" application, I would like to show you how to simulate the motion of mechanical parts using a sketch in Solid Edge together with Microsoft Excel.

Why?

Most of the time, I started my mechanical design with the concept and layout using sketches. If we could simulate the motion of mechanical parts in a sketch, it would help me a lot.

I got this idea when I was playing with sketches and constraints in Solid Edge. Solid Edge allows us to change the dimensions easily by just rotating the mouse wheel.

Watch the following video to see how easy to make the motion in sketch.

video

So what I have to do is just to have Microsoft Excel VBA changes the dimensional values in Solid Edge sketch.

Here is the results of this idea ...

video

Let's see how to do this in the next post...


Read more info about Solid Edge: Ultimate 3D CAD Software

4 comments:

Gustavo said...

Hello.

I´m working actually in a education project to control a Solid Edge assembly from a PLC.

At this time (thanks to this blog) we are working with Visual Basic to generate a continuous motion using the code part taken from this blog:

For RANGO1 = 0 To -ALT Step -VEL
Call objVariables.Edit("POS_VB", RANGO1)
Next RANGO1

Call objVariable.edit, it´s a function that take the variable "POS_VB" from SolidEdge table and update it with the value of the variable Rango1 from Visual Basic.

I would like to make the reverse update, i.e., how can I update the value of a VisualBasic variable (Rango1 for example) with the value of the variable "POS_VB" from SolidEdge table?

Thanks for all.

A teacher from Spain.

Suparerg Suksai said...

Hi there,

Try this...

Set Rango1 = objVariables.Translate("POS_VB")

Please note that this function returns value in meters for the length variables on Solid Edge V.17. Don't forget to multiply it by 1000 to get millimeters.

Hope this answers your question.

Ake

Gustavo said...

Thanks! it´s now working.

With this implementation i can stop a motion between the limits of For/Next code, beaking the loop with a solid edge sensor (minimun distance) as a real sensor could do.

In another way, I can render the solid edge motion better if i include the function DoEvents inside the loop Next/For given the control to the computer for instance to refresh the graphics.

Thanks for all.

Suparerg Suksai said...

Good to hear that.

Good luck with your project.