Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TechDraw] Clip Groups do not work #714

Open
freimair opened this issue Feb 9, 2023 · 1 comment · May be fixed by #716
Open

[TechDraw] Clip Groups do not work #714

freimair opened this issue Feb 9, 2023 · 1 comment · May be fixed by #716

Comments

@freimair
Copy link

freimair commented Feb 9, 2023

Hi there,

I am a fond user of FreeCAD but today I finally found myself in need for Clip Groups in the TechDraw workbench. However, that did not end like I expected. After some digging the interwebs I figure it is indeed a bug.

Steps to recreate

  • create a fresh FreeCAD project
  • switch to TechDraw workbench
  • click the Insert Default Page button on the toolbar
  • select the newly created Page in the tree view
  • click the Insert Clip Group button on the toolbar

Result
image

and the report view as well as console output shows an error message:

23:38:06  App.getDocument('Unnamed').getObject('Page').addView(App.getDocument('Unnamed').getObject('Page')))
23:38:06  <class 'SyntaxError'>: ("unmatched ')'", ('<string>', 1, 99, "App.getDocument('Unnamed').getObject('Page').addView(App.getDocument('Unnamed').getObject('Page')))", 1, 99))

then, when trying to add a View to the Clip Group, the command fails and explains that the View and the Clip Group are not part of the same Page - which is a absolutely correct.

All in all, I could not get any clip group to work as it should.

Expected Result
The Clip Group should appear as a child of the Page object with no error.

Severity
Others seem to have the issue as well. I figure that the bug does not show as often because of all Linkstage users, a whole lot of them might just not use the feature, just as I only found myself in need for the feature and I have been using FreeCAD for years.

https://forum.freecad.org/viewtopic.php?t=58801

My System
OS: Arch Linux (GNOME/gnome-xorg)
Word size of FreeCAD: 64-bit
Version: 0.20.31606 (Git)
Build type: Release
Branch: makepkg
Hash: 853a80f
Python version: 3.10.9
Qt version: 5.15.8
Coin version: 4.0.1
OCC version: 7.6.3
Locale: English/United States (en_US)

Closing
Let me know if I can be of any help. Maybe a hint to the code that might cause that - I might craft up a PR if I manage to solve the issue...

Thanks!

@freimair
Copy link
Author

freimair commented Feb 9, 2023

seems that I have found the cause of the error message at least.

Gui::cmdAppObjectArgs(page, "addView(%s))", getObjectCmd(page));

#686 may actually help: no double parenthesis there.

doCommand(Doc, "App.activeDocument().%s.addView(App.activeDocument().%s)", PageName.c_str(), FeatName.c_str());

https://github.com/FreeCAD/FreeCAD/blob/04f0b66ef71f7e7841cdb7e4e6d4668e62703394/src/Mod/TechDraw/Gui/Command.cpp#L1121

UPDATE:
fixed the parenthesis issue - error is gone, Clip Group is still not a child of the page. so overall and unfortunately, no closer to the expected result.

@freimair freimair linked a pull request Feb 10, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant