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.
realthunder
Posts: 1403
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder » Sat Jan 18, 2020 10:57 pm

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 (latest version 0.10.2) along 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
Posts: 726
Joined: Mon Dec 17, 2018 10:02 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by Zolko » Sat Jan 18, 2020 11:32 pm

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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here

realthunder
Posts: 1403
Joined: Tue Jan 03, 2017 10:55 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by realthunder » Sat Jan 18, 2020 11:57 pm

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 288 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 (latest version 0.10.2) along 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
Posts: 726
Joined: Mon Dec 17, 2018 10:02 am

Re: PR#2862: Configuration Table using Spreadsheet

Post by Zolko » Sun Jan 19, 2020 12:06 am

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 v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here

Post Reply