Macro CloneConvert/de

Beschreibung
Erzeugt einen Klon oder eine Kopie des Objekts und konvertiert es an der gewählten Position und Größe (Zoll, mm, m, µm ...) oder frei. Das Basisobjekt wird in mm (FreeCAd-Basis) erkannt.

Verwendet
Führen Sie das Makro und die XYZ-Einstellungen aus, wählen Sie "Klonen" oder "Kopieren" eine Einheit oder einen Wert Ihrer Wahl. Wählen Sie Ihr Objekt aus und klicken Sie auf die Schaltfläche.

Wenn kein Wert eingegeben wird, wird eine Kopie oder ein Klon ohne Änderung erstellt. Wenn kein Objekt ausgewählt ist, wird die Schaltfläche rot angezeigt.

Der Wert von Bounding Box, Volume und Surface wird in der Berichtansicht angezeigt, im Falle von 'Copy mehreren Objekten das Anzeige zeigt BoundingBox 0.0.

Die Basis ist das mm-Beispiel mit einem Würfel 1 mm der Seite:

Wählen Sie in der ComboBox inch, 1 inch = 25,4 mm die Felder Scale free automatisch auf 25,4 (die Werte in Scale-free kann separat geändert werden). Klicken Sie auf die Schaltfläche. Der erstellte Klon enthält 25, 4 mm x 25,4 mm x 25,4 mm .

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.

If this is not checked the Placement begin in coordinates 0,0,0 of FreeCAD In case a compound Placement information is [0,0,0] the Placement begin in the position of object If the real location is away from the base coordinates 0,0,0 use the button for the real Placement of the subObject selected Face, Wire, Line ....
 * Mode
 * Clone  : The object(s) clone are create
 * Copy   : One copy of the objet(s) is create
 * Comp   : One compound of the objet(s) is create
 * Increm. : incrementing the coordinates data to the original coordinates of the object (Placement, Rotation ...)
 * Unique : If this checkBox is checked and multiple object selected, the clone created is one unique object


 * Coordinates
 *  : This button align the YZ values on the value of X to have the same values ​​XYZ (or manually). Two click reset the coordinates values to 0.0
 * Coordinate X : Move the copy to the Coordinate X selected (Base 0,0,0 if Increm. is not checked)
 * Coordinate Y : Move the copy to the Coordinate Y selected (Base 0,0,0 if Increm. is not checked)
 * Coordinate Z : Move the copy to the Coordinate Z selected (Base 0,0,0 if Increm. is not checked)

Two click reset the rotations values to 0.0
 * Rotation
 *  : This button align the Pitch and Roll values on the value of Yaw to have the same values ​​Rotation (or manually)
 * Yaw (Z )   : Rotate the copy to the axis Z (Yaw) (Begin 0 if Increm. is not checked)
 * Pitch ( Y ) : Rotate the copy to the axis Y (Pitch) (Begin 0 if Increm. is not checked)
 * Roll ( X ) : Rotate the copy to the axis X (Roll) (Begin 0 if Increm. is not checked)


 * 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 or choose a free value in the Scale free field.


 * Number copy 
 * Number copy : number of copies

Two click reset the scales values to 1.0
 * Scale free
 *  : This button align the Scales values on the value of Scale X to have the same values ​​XYZ (or manually)
 * 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)
 * 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)

This option is useful in case a compound Placement information [0,0,0] and its real location is away from the base coordinates 0,0,0 (gives no provide information about the rotation of the object)
 *  : Give the valueAt the subObject selected Face, Wire, Line ...
 *  : the OK button validates and launches the command, if no object is selected the button will be coloured in red
 *  : the Reset button puts all the values to zero
 *  : the Quit button exit the macro

Script
The icon

Macro_CloneConvert.FCMacro

Download the macro to Gist Macro_CloneConvert.FCMacro

Revision
30/03/2018 ver 0.11 = odd checkBox, if multi selection the clone are object unique or object separate

07/06/2017 ver 0.10 = replace Draft...Copy to Part..Shape cause section Copy : not draw copy scaled of object but copy not scaled ??

14/06/2016 ver 0.9 = adding the choice of number of copies and labels optimization

31/01/2016 ver 0.8 = modify the buttons reset section for two click for reset (in case modification the value)

30/01/2016 ver 0.7 = rewriting code with Placement and Increment and adding buttons Compound, Increment, ValueAt,

26/01/2016 ver 0.6 = correction placement with many objets Copy

26/07/2015 ver 0.5 = correction rotate many objects Function Copy

25/07/2015 ver 0.4 = adding rotation

11/08/2014 replace "AttributeError" to "Exception"

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

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