INTELLIGENT WORK FORUMS FOR ENGINEERING PROFESSIONALS
Come Join Us!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- Turn Off Ad Banners
- 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.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site

(Download This Button Today!)
Member Feedback
"...Your site is one of the cleanest and BEST forums that I
have seen. I have sent quite a few people your way. Keep up
the good work!!!"
Geography
Where in the world do Eng-Tips members come from?
|
SolidWorks 3D CAD products FAQ
|
API and Macros
|
Center of Gravity
Posted: 5 Sep 02
|
Dim swApp As Object Dim ModelDoc As Object Dim Point As Object Dim Sketch As Object Dim status As Long
Sub main()
Set swApp = CreateObject("SldWorks.Application") Set ModelDoc = swApp.ActiveDoc MassProp = ModelDoc.GetMassProperties2(status) ModelDoc.Insert3DSketch2 (True) Set Sketch = ModelDoc.GetActiveSketch2 ModelDoc.SetAddToDB (True) Set Point = ModelDoc.CreatePoint2(MassProp(0), MassProp(1), MassProp(2)) ModelDoc.SetAddToDB (False) ModelDoc.Insert3DSketch2 (True) Sketch.Name = "COG " & Format$(Now, "dd.mm.yyyy hh:mm:ss") ModelDoc.EditRebuild End Sub |
Back to SolidWorks 3D CAD products FAQ Index
Back to SolidWorks 3D CAD products Forum
My FAQ Archive
Email This FAQ To A Friend |
|
 |
|