Manipulator WorkBench

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Manipulator WorkBench

Post by easyw-fc »

thschrader wrote: Fri Oct 27, 2017 10:16 am
easyw-fc wrote: Mon Oct 16, 2017 10:06 am Hi @hammax
the Caliper is working in the same philosophy of the DSM Caliper: you get fast measurement for 3D parts
Please have a look at this diskussion:
https://forum.freecadweb.org/viewtopic. ... 0&start=20
no problem at all ... you cannot patent a user friendly way to work with a sw ... I just simplified the way to use the gui: click on an edge and get the measure...
In the past someone tried to patent double click to block other developers, but this was a useless effort
https://www.theregister.co.uk/2010/12/2 ... ck_patent/
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Manipulator WorkBench

Post by oddtopus »

Hello. Thanks to Chris_G, I succeeded to create an "handle" in the graphic window.
Attached an example macro with the parent class that can be customized.
Run it in FreeCAD with few objects in an open viewport. Follow the hints in the Report panel to move the objects.
handle1.py
example for moving objects in viewport
(3.53 KiB) Downloaded 134 times
It' a little "barbarian" yet but, as said some time ago, I hope it can be usefull for Manipulator WB.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Manipulator WorkBench

Post by easyw-fc »

oddtopus wrote: Sun Nov 05, 2017 2:09 pm Hello. Thanks to Chris_G, I succeeded to create an "handle" in the graphic window.
Attached an example macro with the parent class that can be customized.
Run it in FreeCAD with few objects in an open viewport. Follow the hints in the Report panel to move the objects.
handle1.py
It' a little "barbarian" yet but, as said some time ago, I hope it can be usefull for Manipulator WB.
Hi,
I tried the macro in FC0.17 and it doesn't work...
In FC0.16 I get a big arrow compared to the main object(s) ...
this arrow can be clicked to get user mouse input...
but if I press 'Esc' as suggested both in FC0.17 and 0.16 I get:
Unhandled unknown exception caught in GUIApplication::notify.
Unhandled unknown exception caught in GUIApplication::notify.
I'm on Win10 64b

Thx
Maurice
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Manipulator WorkBench

Post by oddtopus »

Alas! :(
It worked fine for me (gnu-linux32), but as explained in this thread i also got some trouble to make it work at first.
https://forum.freecadweb.org/viewtopic.php?f=22&t=25100
Actually I also used the trick of referencing an object inside a function before creating it: maybe it doesn't always work.

I'll search a different way.
Let me have the logs of your error (for example running FC from the prompt C:\freecad -l, or something like that): maybe there's an hint of the cause of the trouble.
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Manipulator WorkBench

Post by easyw-fc »

oddtopus wrote: Wed Nov 08, 2017 7:27 pm Alas! :(
It worked fine for me (gnu-linux32), but as explained in this thread i also got some trouble to make it work at first.
https://forum.freecadweb.org/viewtopic.php?f=22&t=25100
Actually I also used the trick of referencing an object inside a function before creating it: maybe it doesn't always work.

I'll search a different way.
Let me have the logs of your error (for example running FC from the prompt C:\freecad -l, or something like that): maybe there's an hint of the cause of the trouble.
Here a log FC0.17 win64b
(I added a cube, started the macro through a configured button, clicken on a face, then pressed 'Esc')

Code: Select all

Log: Init: Loading FreeCAD GUI
Log: Init: Running FreeCADGuiInit.py start script... done
Log: Init: Activating default workbench StartWorkbench
Log: Loading GUI of Part module... done
Log: Init: Showing main window
Log: Main window restored
Log: Show main window
Log: Toolbars restored
Log: 3Dconnexion device not attached.
Log: Init: Entering event loop
Log: Init: Processing command line files
Log: QImage: XPM color specification is missing: .......gcgcgc", "xpmendext
Log: QImage::QImage(), XPM is not supported
Wrn: Pre-select one or more objects in viewport
	Click on arrow to move
	Ctrl+Alt+Click to go back
	ESC to exit
(Try to change the "displacement" value in the macro)Err: Unhandled unknown exception caught in GUIApplication::notify.
Log: The event type 6 was sent to SIM::Coin3D::Quarter::QuarterWidget
Object tree:
	SIM::Coin3D::Quarter::QuarterWidget is child of
	QStackedWidget is child of
	Gui::View3DInventor is child of
	QMdiSubWindow is child of
	QWidget is child of
	QMdiArea is child of
	Gui::MainWindowErr: Unhandled unknown exception caught in GUIApplication::notify.
Err: Unhandled unknown exception caught in GUIApplication::notify.
Log: The event type 12 was sent to QGLWidget
Object tree:
	QGLWidget is child of
	SIM::Coin3D::Quarter::QuarterWidget is child of
	QStackedWidget is child of
	Gui::View3DInventor is child of
	QMdiSubWindow is child of
	QWidget is child of
	QMdiArea is child of
	Gui::MainWindowErr: Unhandled unknown exception caught in GUIApplication::notify.
Log: The event type 19 was sent to Gui::MainWindow
Object tree:
	Gui::MainWindowLog: Hide main window
Log: Finish: Event loop left
Log: Destruct Gui::Application
Log: FreeCAD terminating...
Log: Saving system parameter...
Log: Saving system parameter...done
Log: Saving user parameter...
Log: Saving user parameter...done
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

Re: Manipulator WorkBench

Post by oddtopus »

This should work.
handle2.py
macro updated
(4.42 KiB) Downloaded 161 times
In fact I tried to run the previous version of the macro in Windows (Vista-32bit) and got your same error. Now it works on both systems for me.
I think that the "ESC" problem deals with how the different OS implement the functions of pivy related to callbacks, so I bypassed the problem creating a dialog to exit the command.

I refined a little the code: now the arrow size is scaled automatically to the average length of edges of the objects selected: so no more "huge" arrows on the screen.
Also the direction and displacement depends upon the faces or edges selected. By the way: remember to select the objects to move before running the macro.

On the code side, I had to import some stuff from the flamingo WB code (so check that the add-on is available in your FC).
Chiefly, a new version of the "arrow" class: I included this latter in the same code of the macro because I did not update the repository in github yet.

So, it's still "barbarian" but usable: it's handy to move quickly objects in the viewport.
I hope it could be of help to create something similar and more easy-to-use in Manipulator WB.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Manipulator WorkBench

Post by HoWil »

Hi maurice,

Is it possible to use your manipulator-wb to move an object from anywhere in 3D to e.g. 0,0,0?
Please see the attached file and the picture to see what I want to achieve.

BR,
HoWil
Attachments
tmp.fcstd
(13.02 KiB) Downloaded 91 times
Screenshot from 2018-02-23 13-04-01.png
Screenshot from 2018-02-23 13-04-01.png (127.3 KiB) Viewed 3638 times
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Manipulator WorkBench

Post by HoWil »

THX, I succeeded with draft-move. This did not work because the compound was somehow corrupt. I simply rebuilt it and now it works.
BR,
HoWil
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Manipulator WorkBench

Post by easyw-fc »

HoWil wrote: Fri Feb 23, 2018 12:23 pm THX, I succeeded with draft-move. This did not work because the compound was somehow corrupt. I simply rebuilt it and now it works.
BR,
HoWil
Hi @HoWill,
good to know you made it :D
M
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Manipulator WorkBench

Post by HoWil »

easyw-fc wrote: Fri Feb 23, 2018 11:06 pm Hi @HoWill,
good to know you made it :D
M
Just because I am curious: Would it be possible with use manipulator wb for such task or is draft-move the only chance? This would help because one would have to switch wbs once less.
HoWil
Post Reply