[Solved] Copy a part body that depends on a spreadsheet
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
[Solved] Copy a part body that depends on a spreadsheet
I'm working on a part in part design but in order to reuse some parameters in other parts I've put all those common parameters in a spreadsheet that is referenced by all the parts of my document.
Now I want to build a part that is similar to the part that I've modeled before but with difference in just one of it's properties. Then I've made a copy of the original Part Body to build a second PartBody but when I paste it, a copy of the spreadsheet is automatically made by freecad.
Considering that I just want to have one spreadsheet centralizing all main parameters, that is an odd behavior.
Conceptually am I doing it the wrong way? Or is it a bug?
The file is:
The body I'm trying to copy is the one named BodyBaseEstrutural.
------------------------
OS: Ubuntu 16.04.6 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Portuguese/Brazil (pt_BR)
Now I want to build a part that is similar to the part that I've modeled before but with difference in just one of it's properties. Then I've made a copy of the original Part Body to build a second PartBody but when I paste it, a copy of the spreadsheet is automatically made by freecad.
Considering that I just want to have one spreadsheet centralizing all main parameters, that is an odd behavior.
Conceptually am I doing it the wrong way? Or is it a bug?
The file is:
The body I'm trying to copy is the one named BodyBaseEstrutural.
------------------------
OS: Ubuntu 16.04.6 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Portuguese/Brazil (pt_BR)
Last edited by Kunda1 on Fri Feb 19, 2021 5:08 pm, edited 1 time in total.
Reason: marked thread [SOLVED]
Reason: marked thread [SOLVED]
Be the change you want to see in the world. - Mahatma Gandhi
Re: Copy a part body that depends on a spreadsheet
On very quick inspection, although a duplicate spreadsheet is created, the second Body actually links to the original spreadsheet. Have a look at the dependency graph. So I think you can safely delete the duplicate spreadsheet.
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.1.
Build type: Release
Python version: 3.6.7
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/Canada (fr_CA)
Re: Copy a part body that depends on a spreadsheet
Shouldn't copying everything down the dependency graph and properly changing links to the new objects be the expected behavior? What if I wanted to make two completely independent copies? Should I change all the expressions to point to the new spreadcheet? It might be worth special treatment of the spreadsheets in the copy operation - ask the user what is current desired behavior?
Re: Copy a part body that depends on a spreadsheet
In my environment, if you already have two bodies referencing the same spreadsheet and you try to copy one of the bodies the new body links to the original spreadsheet but the body that wasn't copied gets all its links updated to the new spreadsheet. A bizarre behavior!
This behavior is really bad because if you have many bodies referencing one centralizing spreadsheet and you make a copy of one of the bodies, you will have a massive rework to correct all things to reproduce the desired result. With this behavior I will have to completely avoid coping things so I will have a lot more work because I will not be able to reuse similar shapes.
Be the change you want to see in the world. - Mahatma Gandhi
Re: Copy a part body that depends on a spreadsheet
I don't think so...
I think a better behavior would be a conditional one:
- If the user selects just the body, the copied object should be just the selected body and all it's links should then reference to the same spreadsheet. (At least that's what I was expecting to happen)
- If the user selects both the body and the spreadsheet, then both objects should be copied and then FreeCAD could have one of two behaviors: 1) Make a copy of both features and automatically reference the body to the new copied spreadsheet or 2) Ask the user what the current desired behavior (to update the references to the new copies or maintain the old references)
Last edited by iogui on Wed May 01, 2019 5:52 pm, edited 2 times in total.
Be the change you want to see in the world. - Mahatma Gandhi
Re: Copy a part body that depends on a spreadsheet
Now that you mention that I remember discusing similar behavior in the past with one of my designs but can't find the threadiogui wrote: ↑Wed May 01, 2019 5:28 pm In my environment, if you already have two bodies referencing the same spreadsheet and you try to copy one of the bodies the new body links to the original spreadsheet but the body that wasn't copied gets all its links updated to the new spreadsheet. A bizarre behavior!
-
- Posts: 2
- Joined: Tue Feb 16, 2021 3:34 pm
Re: Copy a part body that depends on a spreadsheet
Hello,
I recently have started working with FreeCAD and noticed the same behavior.
When copying a part, it copies your Spreadsheet to "Spreadsheet001". After deleting that, you need to "fix" all links in constraints etc.
Strangely not all variables in formulas are changed to the new Spreadsheet, only the first mentioned.
Now I think I have found a quick workaround though:
start your formulas, where you are using variables with 1-1+ [...]
e.g.: 1-1+Spreadsheet.variable
Because the spreadsheet variable is not the first "number" it is not changed to a spreadsheet-copy when copying the part.
Its a small extra work, but for me way better than changing everything afterwards again.
I recently have started working with FreeCAD and noticed the same behavior.
When copying a part, it copies your Spreadsheet to "Spreadsheet001". After deleting that, you need to "fix" all links in constraints etc.
Strangely not all variables in formulas are changed to the new Spreadsheet, only the first mentioned.
Now I think I have found a quick workaround though:
start your formulas, where you are using variables with 1-1+ [...]
e.g.: 1-1+Spreadsheet.variable
Because the spreadsheet variable is not the first "number" it is not changed to a spreadsheet-copy when copying the part.
Its a small extra work, but for me way better than changing everything afterwards again.
Re: Copy a part body that depends on a spreadsheet
In V0.19 you can specify if you want to include the spreadsheet in the copy-paste operation. So there should be no need for your workaround.
Re: Copy a part body that depends on a spreadsheet
Hi and welcome to the forum!
Edit: Roy beat me to it. He probably knew the answer, while I had to check.
You didn't post your FreeCAD infos, but in 0.19 you can unselect the spreadsheet to be copied with the body. This keeps the expressions correct without any workaround.
Edit: Roy beat me to it. He probably knew the answer, while I had to check.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 2
- Joined: Tue Feb 16, 2021 3:34 pm
Re: Copy a part body that depends on a spreadsheet
Well, time to updadte I guess!
Thank you for the info!
Thank you for the info!