Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB interface to Feature.MoveCopyBody2 1

Status
Not open for further replies.

alexit

Mechanical
Dec 19, 2003
348
From the help files I find

Set swFeat = swFeatMgr.InsertMoveCopyBody2( _
0.1, 0.2, 0.3, _
0#, _
0#, 0#, 0#, _
0#, 0#, 0#, _
False, 1)

as example to script move of body. However, when I put value 0.1 into this is moved 3.937 inches, this makes no sense. It is not mm to inch conversion to move 1" you enter 1/39.37! Has anyone tried this function before? What is real data needed? (The conversion 39.37 is not accurate enough as I get cumulative error and I move bodies many time in script.

Please advise.

Thanks,
Alex


 
Replies continue below

Recommended for you

Actually it is a Metric conversion!
1 Metre = 39.3696"

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
What the ???

Lets try that again ...
1 meter = 39.37007874"

[cheers]
Helpful SW websites FAQ559-520
How to get answers to your SW questions FAQ559-1091
 
If you look in the API help under Units, it states:
Unless otherwise stated, all SolidWorks API functions use metric units. Specifically, the SolidWorks API accepts or returns values as meters, radians, kilograms, square meters, or cubic meters.

This means if you want to move inches you will have to convert it to meters using the conversion supplied by CBL or for more accuracy, you could use 1 metre (meter) = 1000#/25.4# .

Regards,

Regg


 
I was looking all over to see if VB was set for mm or m...never find this. Thanks to both!

Second question, what is the '#' used for in this?
 
# is VB to force variable to double precision.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor