Macro MultiCopy: Difference between revisions

From FreeCAD Documentation
mNo edit summary
mNo edit summary
Line 5: Line 5:
|Description=MultiCopy allows the duplication (copy and paste) of multiple FreeCAD objects that can be labelled sequentially and in a custom manner.
|Description=MultiCopy allows the duplication (copy and paste) of multiple FreeCAD objects that can be labelled sequentially and in a custom manner.
|Author=Melwyncarlo
|Author=Melwyncarlo
|Date=2021-03-17
|Date=2021-03-18
|Version=1.0.0
|Version=1.0.1
|FCVersion={{VersionPlus|0.17}}
|FCVersion={{VersionPlus|0.17}}
|Download=[https://github.com/melwyncarlo/MultiCopy/blob/main/MultiCopy.zip?raw=true MultiCopy.zip]
|Download=[https://github.com/melwyncarlo/MultiCopy/blob/main/MultiCopy.zip?raw=true MultiCopy.zip]
Line 105: Line 105:
__Title__ = "MultiCopy"
__Title__ = "MultiCopy"
__Author__ = "Melwyncarlo"
__Author__ = "Melwyncarlo"
__Version__ = "1.0.0"
__Version__ = "1.0.1"
__Date__ = "2021-03-17"
__Date__ = "2021-03-18"
__Comment__ = "MultiCopy allows the duplication (copy and paste) of "\
__Comment__ = "MultiCopy allows the duplication (copy and paste) of "\
"multiple FreeCAD objects that can be labelled sequentially "\
"multiple FreeCAD objects that can be labelled sequentially "\

Revision as of 05:28, 18 March 2021

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Macro MultiCopy

Description
MultiCopy allows the duplication (copy and paste) of multiple FreeCAD objects that can be labelled sequentially and in a custom manner.

Macro version: 1.0.1
Last modified: 2021-03-18
FreeCAD version: version 0.17 and above
Download: MultiCopy.zip
Author: Melwyncarlo
Author
Melwyncarlo
Download
MultiCopy.zip
Links
Macro Version
1.0.1
Date last modified
2021-03-18
FreeCAD Version(s)
version 0.17 and above
Default shortcut
None
See also
None

Description


'MultiCopy' is a user-created macro to be used within the FreeCAD application. MultiCopy allows the duplication (copy and paste) of multiple FreeCAD objects that can be labelled sequentially and in a custom manner.


   This is the MultiCopy Macro icon.



Key Features

  • Two input methods: by mouse, or by keyboard (Paste Code Commands)
  • Standard Copy and Simple Copy methods supported
  • Duplication across two different documents
  • Delete selected objects after duplication
  • Duplicate with or without dependencies
  • Add custom label separators
  • Add padded numbering to labels
  • Numbering types: Ordinary numerals, upper/lower-case roman numerals and upper/lower-case alphabetic characters
  • Unique 'Paste Code Commands' that allow multiple duplication procedurally as well as in nested loops



Macro_MultiCopy_Main_Dialog.png
Caption : MultiCopy Macro Main Dialog Box



Installation


Linux

MultiCopy can be installed manually, similar to Windows installation, or by using the command terminal and its relevant commands as mentioned in the INSTALL file.

By default, the Linux command terminal can be launched by pressing the following keyboard keys simultaneously :

Control + Alt + T


Windows

MultiCopy can be installed with the help of the following two steps :-

  1. Download the MultiCopy.zip file.
  2. Extract the ZIP file's contents into the FreeCAD User Macro directory location.

By default, the FreeCAD User Macro directory should be located at :

~/.FreeCAD/Macro


Usage


MultiCopy can be loaded by performing the following steps :-

  1. Launch the FreeCAD application.
  2. Go to Macro → Macros ....
  3. Click on the User macros tab in the pop-up dialog box.
  4. Select MultiCopy.FCMacro.
  5. Click on Execute.


Before loading the MultiCopy macro, first select one or more objects from the active FreeCAD doccument, then load the macro. Next, follow the instructions in the dialog box, fill in the required inputs, and click on the 'Paste' button. In case of error or warning, you will automatically be notified of the same. In case you come across an unexpected error, communicate the error by mentioning the FreeCAD version, tracing the steps taken, and mentioning whether (and how much) or not any ouput was generated.


Notes

(1) There are a few inevitable from-to naming clashes between roman numerals and alphabetic characters.
E.g.: c, v, i, x, etc.
(2) By design, roman numerals take precedence over alphabetic characters.
(3) Dependencies only apply to 'Standard Copy'; its application on 'Simple Copy' will automatically be ignored.


Paste Code Commands


Macro_MultiCopy_Commands.png
Caption : MultiCopy Macro 'Paste Code Commands' List


[ To be completed soon . . .]



Macro_MultiCopy_Input_Signal.png
Caption : MultiCopy Macro 'Paste Code Commands' - Input Signal


Macro_MultiCopy_Incorrect_Signal.png
Caption : MultiCopy Macro 'Paste Code Commands' - Incorrect Signal


Macro_MultiCopy_Correct_Signal.png
Caption : MultiCopy Macro 'Paste Code Commands' - Correct Signal


Script

__Title__         = "MultiCopy"
__Author__        = "Melwyncarlo"
__Version__       = "1.0.1"
__Date__          = "2021-03-18"
__Comment__       = "MultiCopy allows the duplication (copy and paste) of "\
                    "multiple FreeCAD objects that can be labelled sequentially "\
                    "and in a custom manner."
__Web__           = "https://github.com/melwyncarlo/MultiCopy"
__Wiki__          = "http://www.freecadweb.org/wiki/index.php?title=Macro_MultiCopy"
__Icon__          = "MultiCopy_UI_Files/MultiCopy.svg"
__Help__          = "Select one or more FreeCAD objects, then click on the "\
                    "MultiCopy button/macro, and follow the instructions in the dialog box."
__Status__        = "stable"
__Requires__      = "Freecad >= v0.17"
__Communication__ = "https://github.com/melwyncarlo/MultiCopy/issues"
__Files__         = "MultiCopy_UI_Files/MultiCopy_Main_Dialog.ui, "\
                    "MultiCopy_UI_Files/MultiCopy_Commands_Dialog.ui, "\
                    "MultiCopy_UI_Files/mc_d_imgs.gif, "\
                    "MultiCopy_UI_Files/MultiCopy.svg"



#  OS: Ubuntu 18.04.5 LTS
#  Word size of OS: 64-bit
#  Word size of FreeCAD: 64-bit
#  Version: 0.18.4.
#  Build type: Release
#  Python version: 3.6.8
#  Qt version: 5.9.5
#  Coin version: 4.0.0a
#  OCC version: 7.3.0
#  Locale: English/UnitedKingdom (en_GB)

#  OS: Ubuntu 18.04.5 LTS (LXDE/Lubuntu)
#  Word size of OS	: 64-bit
#  Word size of FreeCAD: 64-bit
#  Version: 0.19
#  Build type: Release
#  Branch: unknown
#  Hash: 32200b604d421c4dad527fe587a7d047cf953b4f
#  Python version: 3.6.9
#  Qt version: 5.9.5
#  Coin versio: 4.0.0a
#  OCC version: 7.3.0
#  Locale: English/UnitedKingdom (en_GB)

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/melwyncarlo/MultiCopy/main/MultiCopy.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/melwyncarlo/MultiCopy/main/MultiCopy.FCMacro")


Links

[1] MultiCopy Github Repository
[2] FreeCAD Macros Github Repository - MultiCopy
[3] FreeCAD Forum Discussion Page - MultiCopy