×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Excell/API/Macro/Conversion

Excell/API/Macro/Conversion

Excell/API/Macro/Conversion

(OP)
I'm writing a macro within Excel.  When I transfer a cell value into a SolidWorks model dimension I divide the cell value by 1000 to get a millimeter value for the model, as in the following example:

Part.Parameter("Dim@Sketch@Model.SLDPRT").SystemValue = [cell].Value / 1000

This works fine for linear dimensions.

Problem: I want to transfer an angular value.  I can't seem to figure out what the relationship is during the transfer.  For instance, when I want to transfer the value of 36°, it transforms into 2063°.

Does anyone have a suggestion for a conversion factor?  It doesn't appear to even be a radian value, ie. 36/360*2pi = .628pi.  The closest that I can get is (36/1000) * (36/2), but this yields 37°+.

I'm totally baffled.

Regards,

Christopher Zona
Litens Automotive Partnership
Concord, Ontario, Canada

RE: Excell/API/Macro/Conversion

i'm baffled as well...

have you considered calculating the radian value within excel, then transferring the radian value to solidworks, and then changing the radian value to degrees in solid works?   a possible workaround?  not familiar with solidworks...

-pmover

RE: Excell/API/Macro/Conversion

Why are you baffled?

36 radians is 2062.6º.  And given that the default angle measurement unit in Excel is radians, this makes perfect sense.

TTFN

RE: Excell/API/Macro/Conversion

Krywarick6,
you can use the built-in function "degrees()" if you want to display an angle in degrees; the formula
=degrees(angle_in_radians)
is perfectly legal, see the help in excel.

I do not know details about your calculations, but if you need to convert meters (i believe) to millimeters, you need to multiply by 1000, not divide...

RE: Excell/API/Macro/Conversion

(OP)
Great stuff guys, thanks for the help.

gearguru - I heed what you're saying.  My reason is this:  when the cell value leaves Excel and goes to SolidWorks it is interpretted a meter value when it enters SolidWorks.  If the value is divided by 1000 when it leaves Excell then it is seen as a decimal meter.  Otherwise I would totally agree.  Thanks

Regards

Chris

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close