×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

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!
  • Students Click Here

*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

Jobs

VB interface to Feature.MoveCopyBody2

VB interface to Feature.MoveCopyBody2

VB interface to Feature.MoveCopyBody2

(OP)
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


RE: VB interface to Feature.MoveCopyBody2

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

RE: VB interface to Feature.MoveCopyBody2

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

RE: VB interface to Feature.MoveCopyBody2

If you look in the API help under Units, it states:

Quote:

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

 

RE: VB interface to Feature.MoveCopyBody2

(OP)
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?

RE: VB interface to Feature.MoveCopyBody2

# is VB to force variable to double precision.

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!


Resources