Macro CenterOfMass: Difference between revisions

From FreeCAD Documentation
(create page)
 
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


<!--T:5-->
{{Macro|Icon=Text-x-python|Name=Macro CenterOfMass|Description=Gives the Center of mass multiple of multiple objects selected.|Author=schupin|Version=0.1.2|Date=2018-11-10}}
{{Macro|Icon=Text-x-python|Name=Macro CenterOfMass|Description=Gives the Center of mass multiple of multiple objects selected.|Author=schupin|Version=0.1.2|Date=2018-11-10}}


==Description==
==Description== <!--T:6-->


<!--T:7-->
Gives the Center of mass multiple of multiple objects selected with the density chosen.
Gives the Center of mass multiple of multiple objects selected with the density chosen.
</translate>
</translate>
Line 14: Line 16:
<translate>
<translate>


<!--T:8-->
The value result can be saved in a spreadsheet
The value result can be saved in a spreadsheet
</translate>
</translate>
Line 22: Line 25:
==How to use== <!--T:4-->
==How to use== <!--T:4-->


<!--T:9-->
Select the object(s)
Select the object(s)


<!--T:10-->
Run the macro
Run the macro


==Script==
==Script== <!--T:11-->




<!--T:12-->
icon file download and paste in the same directory of the macro
icon file download and paste in the same directory of the macro
</translate>
</translate>
Line 36: Line 42:
'''Macro CenterOfMass.FCMacro'''
'''Macro CenterOfMass.FCMacro'''
<translate>
<translate>
<!--T:13-->
Download in Github
Download in Github


Line 43: Line 50:


<translate>
<translate>
==Link==
==Link== <!--T:14-->


<!--T:15-->
the forum discussion [https://forum.freecadweb.org/viewtopic.php?f=24&t=31883 Macro to compute center of mass]
the forum discussion [https://forum.freecadweb.org/viewtopic.php?f=24&t=31883 Macro to compute center of mass]


==Version==
==Version== <!--T:16-->


<!--T:17-->
0.1.2 / 2018-11-10 : xx
0.1.2 / 2018-11-10 : xx
</translate>
</translate>

Revision as of 14:50, 13 November 2018

File:Text-x-python Macro CenterOfMass

Description
Gives the Center of mass multiple of multiple objects selected.

Macro version: 0.1.2
Last modified: 2018-11-10
Author: schupin
Author
schupin
Download
None
Links
Macro Version
0.1.2
Date last modified
2018-11-10
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Description

Gives the Center of mass multiple of multiple objects selected with the density chosen.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Information/CenterOfMass.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Information/CenterOfMass.FCMacro")


File:Macro CenterOfMass 01.png

The value result can be saved in a spreadsheet

File:Macro CenterOfMass 02.png

How to use

Select the object(s)

Run the macro

Script

icon file download and paste in the same directory of the macro

File:SaveIcon.png File:CdgIcon.png File:ComputeIcon.png File:ImportIcon.png File:MaterialIcon.png

Macro CenterOfMass.FCMacro Download in Github


Macro CenterOfMass.FCMacro

Link

the forum discussion Macro to compute center of mass

Version

0.1.2 / 2018-11-10 : xx