I am reading trough the thread now trying to figure out what carlo did.vocx wrote: ↑Mon Oct 14, 2019 10:39 pmAlso see carlo's thread where he precisely implemented a function in the context menu for the Arch SectionPlane, [feature request] Section Plane - Cut View Context menu.
Draft Edit improvements
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Draft Edit improvements
Re: Draft Edit improvements
Probably adding a context menu for when the user right click on the editing node is way more complicated.
The edit command have its own selection mechanism that rely on coin3d soraypickaction. So when the user moves the mouse around or click somewhere on the screen, Draft Edit evaluate the event and look for a node in the mouse position.
I was thinkin to make something happen when user right click somewhere and a node is nearby, but i didnt investigate much further.
Did you have a look at draft edit? did you understand less or more how it works? i'm sorry cause it's still in developing and not much documented...
follow my experiments on BIM modelling for architecture design
Re: Draft Edit improvements
I looked at Draft and Arch section a bit to see what are ViewProviders. I saw that you implemented a context menu for the Arch section so I wanted to see how you did it.carlopav wrote: ↑Tue Oct 15, 2019 12:52 pmProbably adding a context menu for when the user right click on the editing node is way more complicated.
The edit command have its own selection mechanism that rely on coin3d soraypickaction. So when the user moves the mouse around or click somewhere on the screen, Draft Edit evaluate the event and look for a node in the mouse position.
I was thinkin to make something happen when user right click somewhere and a node is nearby, but i didnt investigate much further.
Did you have a look at draft edit? did you understand less or more how it works? i'm sorry cause it's still in developing and not much documented...
My idea was to have a context menu depend on the type of the object that is selected. So for example if a line is selected, I would like to have a context menu with commands like: edit, move, rotate, stretch and maybe a couple of more. And if I select a wall or something else I would have a different context menu with some other commands. Something similar to the context menu that is used in sketcher, but with only five or six commands avalible. So it would be something like "If line is selected when you right click somewhere in the viewport you get a coressponding context menu." Maybe this is what vocx had in mind when he answered before but I am not sure
Re: Draft Edit improvements
I thinks so. This https://github.com/FreeCAD/FreeCAD/blob ... -L160looks like the main place to handle context menu on the view. Probably if FreeCAD.activeDraftCommand.featureName == "Edit": something could happen!
follow my experiments on BIM modelling for architecture design
Re: Draft Edit improvements
My end goal would be to have something like this in freecad.
a combination of an icon context menu and a text context menu.
a combination of an icon context menu and a text context menu.
Re: Draft Edit improvements
That's interesting, maybe you can act as lots of things in freecad were developed: start with something simple and then figure out how to make it better day by day. I think achieving a proper text content menu is ATM a good challenge!
follow my experiments on BIM modelling for architecture design
Re: Draft Edit improvements
That was my plan start simple and go from there.
Re: Draft Edit improvements
Hey carlo, I noticed this string in the code
Which displays like this
I would avoid using the degree symbol. It is probably ASCII, and it should work okay everywhere, but I personally think it's best to avoid abbreviations. Using more explicit words is better for translation. That particular string is already a string so it doesn't need to be inside str(). I'd also use obj.Label so it matches the name that the user sees in the tree view.
Code: Select all
FreeCAD.Console.PrintMessage(str(self.obj.Name)+str(": editing node: n° ")+str(ep)+"\n")
Code: Select all
Wire: editing node: n° 2
Code: Select all
Msg = FreeCAD.Console.PrintMessage
_msg = QT_TRANSLATE_NOOP("Draft", "editing node")
Msg("{0}: {1} {2}\n".format(self.obj.Label, _msg, ep))
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Draft Edit improvements
Hey Carlo, in this same thread in page 6, you show an animated Gif of editing simultaneously various elements.
However, in the code this seems to be limited by a variable
https://github.com/FreeCAD/FreeCAD/blob ... dit.py#L67
What's the purpose of this? Were you trying things and disabled the multi-object edit?
However, in the code this seems to be limited by a variable
Code: Select all
self.maxObjects = 1
What's the purpose of this? Were you trying things and disabled the multi-object edit?
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Draft Edit improvements
Ok for the degree symbol, I'll try to avoid it.
Multi object editing should already work, BUT the taskpanel is ATM made to handle just one object settings: we can edit contemporary a wire and a bezcurve, but just the option for one of them will be displayed. So I limited it at least until I move editing options from taskpanel to context menu (the menu should get the object from the clicked node).
Multi object editing should already work, BUT the taskpanel is ATM made to handle just one object settings: we can edit contemporary a wire and a bezcurve, but just the option for one of them will be displayed. So I limited it at least until I move editing options from taskpanel to context menu (the menu should get the object from the clicked node).
follow my experiments on BIM modelling for architecture design