PR#2862: Configuration Table using Spreadsheet

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

Zolko wrote: Sat Jan 18, 2020 10:00 pm And while we're at it, is there a Python command/script that allows to open/activate a document that is already open in the background ? Something equivalent to right-click > Activate Document > ... or right-click > Link actions > Go to linked object ? Or, alternatively, bring that function Link actions > Go to linked object to the first right-click level, something like, when right-click on an App::Link object, Go to Document and that opens the corresponding document ?
Not really sure what you want, but if you can do it with some toolbar button, then you can always copy the command output from the Python console for coding.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by Zolko »

realthunder wrote: Sat Jan 18, 2020 10:57 pm Not really sure what you want, but if you can do it with some toolbar button, then you can always copy the command output from the Python console for coding.
I'm a little disappointed: you should know that of course I did try that, and if I ask it's because that doesn't work. It says:

Code: Select all

Gui.runCommand('Std_LinkSelectLinked',0)
What I wish is simple: that the right-click action on an App::Link, in the contextual menu, in the sub-menu Link actions > go to linked object gets into the first level of the contextual menu, with the text Open document. In other words, if the user right-clicks on an App::Link, appears somewhere in the pop-up menu the command : Open document which activates the open but hidden document of the linked part.

Please
try the Assembly4 workbench for FreCAD — tutorials here and here
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

Zolko wrote: Sat Jan 18, 2020 11:32 pm What I wish is simple: that the right-click action on an App::Link, in the contextual menu, in the sub-menu Link actions > go to linked object gets into the first level of the contextual menu, with the text Open document. In other words, if the user right-clicks on an App::Link, appears somewhere in the pop-up menu the command : Open document which activates the open but hidden document of the linked part.
This function is already there. You'll just have to enable tree view option 'Sync View', which will auto switch to the hidden view of the linked document.
Screenshot from 2019-08-24 15-16-41.png
Screenshot from 2019-08-24 15-16-41.png (39.3 KiB) Viewed 7920 times

If you are asking how to do it yourself, here is the code.

Code: Select all

# Assuming there is a App::Link in the active document named 'Link'
linked = App.ActiveDocument.Link.LinkedObject

# in case linking to a sub-object
if isinstance(linked, tuple):
	linked = linked[0].getSubObject(linked[1], retType=1)

App.setActiveDocument(linked.Document.Name)
Gui.activateView('Gui::View3DInventor', True)
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by Zolko »

realthunder wrote: Sat Jan 18, 2020 11:57 pm If you are asking how to do it yourself, here is the code.
yes, that did it, thank-you.

EDIT: this is awesome, I've been wanting this function for ages !
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
czinehuba
Posts: 160
Joined: Mon Oct 15, 2018 4:59 am
Location: UK
Contact:

Re: PR#2862: Configuration Table using Spreadsheet

Post by czinehuba »

Hi,

I wanted to try configuration table using spreadsheet.
But can't get it to work.
9-146280-0.FCStd
(90.38 KiB) Downloaded 145 times
I've attached the file.
When I add App::PropertyEnumeration the Enum box doesn't appear, so I can't fill it in.

Any advice.


Many thanks
Huba
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

czinehuba wrote: Tue Apr 14, 2020 11:06 am I wanted to try configuration table using spreadsheet.
But can't get it to work.
This PR has not been merged yet. Are you trying my branch? I have just update the branch to rebase with the latest upstream. You can try again.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
czinehuba
Posts: 160
Joined: Mon Oct 15, 2018 4:59 am
Location: UK
Contact:

Re: PR#2862: Configuration Table using Spreadsheet

Post by czinehuba »

realthunder wrote: Wed Apr 15, 2020 5:05 am
czinehuba wrote: Tue Apr 14, 2020 11:06 am I wanted to try configuration table using spreadsheet.
But can't get it to work.
This PR has not been merged yet. Are you trying my branch? I have just update the branch to rebase with the latest upstream. You can try again.
Thanks for the reply. I tough it was merged. I must have misread it.
I compiled it and it seems to work.
I'm going to play around with it now. :D
User avatar
czinehuba
Posts: 160
Joined: Mon Oct 15, 2018 4:59 am
Location: UK
Contact:

Re: PR#2862: Configuration Table using Spreadsheet

Post by czinehuba »

The compiled version was messing up pasting the values. But 0.11 app-image works.

Awesome.
Many thanks for your work. Long awaited feature. :D :D :D
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: PR#2862: Configuration Table using Spreadsheet

Post by carlopav »

realthunder wrote: Wed Apr 15, 2020 5:05 am ping
Hello realthunder, I have a really desirable usecase for architectural workflow, and I'd really like to understand if it is something feasible using configuration table.
Reference to this simple parametric window:
Finestra tipo.FCStd
Standard window part
(26.43 KiB) Downloaded 141 times

It's an App::Part that uses an App::FeaturePython object ("Variables") to set "configuration values" in the Assembly4 style.
The Window can be linked into an arch model and added to a wall (the one that you kindly helped me to experiment). The wall gets so the WallVoid shape for the boolean cut of the window opening.
Height, Width and WallWidth have to be customizable for every window instance (and expecially WallWidth have to be adapted to the host wall).
So I'd like to Link that window Part and be able to change those values on demand.
We do not want to preserve the object hierarchy, we just need the 2 shapes: the window and the wall void.
Do you think it could be something feasible, considering that the WallWidth property have to be adjusted always on the fly when we know the width of the hosting wall?
Thanks in advance :)
follow my experiments on BIM modelling for architecture design
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder »

carlopav wrote: Sat May 09, 2020 8:51 pm Do you think it could be something feasible, considering that the WallWidth property have to be adjusted always on the fly when we know the width of the hosting wall?
Yes, it is possible. I just tried it. Since you don't need the object hierarchy, you should use SubShapeBinder. However, I just discovered that SubShapeBinder will lose shape color if binding to external object. I'll fix that first.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
Post Reply