Macro CloneConvert/fr

Description
Creates a clone or copy of the object and the converted in the chosen position and size (inch, mm, m, µm...) or free. The base object is recognized in mm (FreeCAd base)

Uses
Run the macro, the XYZ settings, choose "Clone" or "Copy" a unit or one value of choice select your object, and click button.

If no value is entered a copy or clone will be created without modification. If no object is selected the button will be colored in red.

The value of the BoundingBox, Volume and Surface is diplayed in the Report view, in the case of Copy multiple object, the display will show BoundingBox 0.0.

L'unité de base est le mm (l'objet sélectionné est considéré comme un objet dont l’unité est le mm).

Exemple avec un cube de 1 mm de côtés :

Sélectionnez dans la liste déroulante (combobox) l'unité inch (pouce), la valeur des champs Scales free s'ajustent automatiquement à 25,4 mm qui correspond à un pouce (ces champs peuvent être modifiés séparément). Cliquez sur le bouton, le clone de l'objet ici le cube de 1 mm de côtés aura comme dimensions 25,4 mm x 25,4 mm x 25,4 mm.

Opération inverse :

Si vous voulez réduire un objet par exemple le cube de 25,4 mm (1 pouce) en un cube de 1 mm de côtés, utilisez la formule suivante, 1 / 25,4 = 0,0393700 et entrez la valeur 0,0393700 (avec une virgule) dans les champs Scale XY et Z.

Dans un cube de 5 mm, faites 5 / 25,4 = 0,1968503 et entrez la valeur 0,1968503 (avec une virgule) dans les champs Scale XY et Z.

150% = 1,50 in the "Scale free" fields

104% = 1,04 in the "Scale free" fields

Inverse operation :

If you want to reduce an object ex: a cube 25.4 mm (1 inch) in cube 1 mm sides, use the following formula, 1 / 25.4 = 0.0393700 and enter the value 0,0393700 (with comma) in the Scale field XY and Z.

In a cube of 5 mm, made​​ 5 / 25.4 = 0.1968503 and enter the value 0,1968503 (with comma) in the Scale field XY and Z.

50% = 0,50 in the "Scale free" fields

 4% = 0,04 in the "Scale free" fields

Predefined units are :

km, hm, dam, m, dm, cm, mm, µm, nm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique.

or choose a free value in the Scale free field.
 * Mode
 * Clone : One clone of the objet(s) is create
 * Copy : One copy of the objet(s) is create
 * Coordinate X : Move the copy to the Coordinate X selected
 * Coordinate Y : Move the copy to the Coordinate Y selected
 * Coordinate Z : Move the copy to the Coordinate Z selected
 * Scale predefined
 * Scale predefined : predefined scales in units, km, hm, dam, m, dm, cm, mm, µm, nm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique
 * Scale predefined
 * Scale predefined : predefined scales in units, km, hm, dam, m, dm, cm, mm, µm, nm, inch, link, foot, yard, perch, chain, furlong, mile, league, nautique
 * Scale free
 * Scale X : free scale, if the value is negative ( -10) , the object is scaled x 10 and will be reversed in the X axis, to reduce the shape give a decimal value (0,5)
 *  : This button align the YZ values on the value of X to have the same values ​​XYZ (or manually)
 * Scale Y : free scale, if the value is negative ( -10) , the object is scaled x 10 and will be reversed in the Y axis, to reduce the shape give a decimal value (0,5)
 * Scale Z : free scale, if the value is negative ( -10) , the object is scaled x 10 and will be reversed in the Z axis, to reduce the shape give a decimal value (0,5)
 *  : the OK button validates and launches the command, if no object is selected the button will be colored in red
 *  : the Reset button puts all the values to zero
 *  : the Quit button exit the macro
 *  : the Reset button puts all the values to zero
 *  : the Quit button exit the macro

Script
Macro_CloneConvert.FCMacro

Revision
02/07/2014 ver. 0.3 = modified to operate PyQt4 and PySide

09/05/2014 ver. 0.2 = adding function "Copy"