Jump to content

Copy Elements onto another part?


---
 Share

Recommended Posts

---

Hello,

I need to copy a few Elements from one part to another and rename them via script, but none of the methods seem ideal.

Copying and pasting from clipboard creates the copy on the same part, ignoring whatever is written in gom.script.sys.paste_from_clipboard (destination=[...]])

Exporting to and then importing from files has all kinds of problems:

.csv doesn't support exporting sections or measuring principles, 

.xml also doesn't copy measuring principles,

ASCII, VDA/PSET, MEA, IGES, UFF don't support coordinate systems,

.zelements do work, but the file can't be read/written manually, meaning if i import it, objects can get a " copy" at the end of their name or if they end in a number, it gets counted up by 1 automatically. When this happens the script can't find them and crashes.

 

Is there a better way to achieve this?

Link to comment
Share on other sites

---

Maybe the following approach - "packaged" in a script - is practical:
1. Export the desired elements to a zelements file
2. Import this file to the clipboard
3. Renaming the elements
4. Moving the renamed elements from the clipboard to the target part

Link to comment
Share on other sites

 Share

×
×
  • Create New...