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
Thanks guys, i'm happy you appreciate the improvements
Basically what I'd like from user point of view:
- make nodes easier to deal with: preview mouseover, pop up a context menu (on mouseover or rightclick) to allow handling options without having to use task panel (adding points, removing points, change bezcurve node options);
- extend editing to every draft and arch object (maybe also to other wb objects);
- supporting preview during editing for every supported object type;
- make the tool "always active", so when the user select only one object, editing nodes are displayed.
That's all but i'm very far from that, and i'm having a quite busy time at work atm.
Basically what I'd like from user point of view:
- make nodes easier to deal with: preview mouseover, pop up a context menu (on mouseover or rightclick) to allow handling options without having to use task panel (adding points, removing points, change bezcurve node options);
- extend editing to every draft and arch object (maybe also to other wb objects);
- supporting preview during editing for every supported object type;
- make the tool "always active", so when the user select only one object, editing nodes are displayed.
That's all but i'm very far from that, and i'm having a quite busy time at work atm.
follow my experiments on BIM modelling for architecture design
Re: Draft Edit improvements
This would be a great improvement. A lot of things that use the task panel could be moved to the context menu. Like you said add and remove points, but also commands such as move, stretch and rotate could be in the context menu. This is how a lot of programs function for example ArchiCAD and BricsCAD. Would it be difficult to make the context menu asociative so that the options you have change when you select a different type of object? So a context menu for a line and wall would be different.- make nodes easier to deal with: preview mouseover, pop up a context menu (on mouseover or rightclick) to allow handling options without having to use task panel (adding points, removing points, change bezcurve node options);
We could already have something like a context menu with the Command panel plugin.
Re: Draft Edit improvements
It is already possible to add context menus.
https://github.com/FreeCAD/FreeCAD/blob ... #L147-L160
Code: Select all
def ContextMenu(self, recipient):
if recipient == "View":
if FreeCAD.activeDraftCommand is None:
if FreeCADGui.Selection.getSelection():
self.appendContextMenu("Draft", self.cmdList + self.modList)
self.appendContextMenu("Utilities", self.treecmdList)
else:
self.appendContextMenu("Draft", self.cmdList)
else:
if FreeCAD.activeDraftCommand.featureName == "Line":
self.appendContextMenu("", self.lineList)
else:
if FreeCADGui.Selection.getSelection():
self.appendContextMenu("Utilities", self.treecmdList)
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
Oh great than. Does adding new context menus require some pro level of Python, or can a relative novice(like my self) do it?vocx wrote: ↑Sat Oct 12, 2019 3:14 pm It is already possible to add context menus.
https://github.com/FreeCAD/FreeCAD/blob ... #L147-L160However, this isn't very smart at the moment. Probably a bigger list of objects should be considered.Code: Select all
def ContextMenu(self, recipient): if recipient == "View": if FreeCAD.activeDraftCommand is None: if FreeCADGui.Selection.getSelection(): self.appendContextMenu("Draft", self.cmdList + self.modList) self.appendContextMenu("Utilities", self.treecmdList) else: self.appendContextMenu("Draft", self.cmdList) else: if FreeCAD.activeDraftCommand.featureName == "Line": self.appendContextMenu("", self.lineList) else: if FreeCADGui.Selection.getSelection(): self.appendContextMenu("Utilities", self.treecmdList)
Re: Draft Edit improvements
I think you can try! It's relatively funny to put your hands on the code I already gave one try some months ago but didnt succed at first attempt, so i concentrated on other stuff (mind that that's the first project I'm contributing and i'm not a programmer at all). Keep asking if we can give you some help!
follow my experiments on BIM modelling for architecture design
Re: Draft Edit improvements
Python is an easy to learn programming language because it has a very clean structure. You can read the code and almost understand what it does at a glance. In many cases the best way of learning is by copying parts of the code, modifying them, and testing if they work as you want. This is possible to do even if you don't know all features of the language.
For example, in the snippet above, it seems to test the currently active Draft tool; if it finds a match it displays one menu, otherwise, it displays a different menu. Maybe you can try different things with different tools (square, circle, rectangle, line, etc.), and see how it works.
Code: Select all
if FreeCAD.activeDraftCommand is None:
...
else:
if FreeCAD.activeDraftCommand.featureName == "Line":
self.appendContextMenu("", self.lineList)
# Test for other objects
if FreeCAD.activeDraftCommand.featureName == "Circle":
self.appendContextMenu("", self.circleList)
if FreeCAD.activeDraftCommand.featureName == "Rectangle":
self.appendContextMenu("", self.rectangleList)
...
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
Will do, thanks for the support I will try to concentrate on some simple things first and go from there.I think you can try! It's relatively funny to put your hands on the code I already gave one try some months ago but didnt succed at first attempt, so i concentrated on other stuff (mind that that's the first project I'm contributing and i'm not a programmer at all). Keep asking if we can give you some help!
I did some coding in Python couple of years ago, but I forgot a lot It really is simple to use and a logical language.Python is an easy to learn programming language because it has a very clean structure. You can read the code and almost understand what it does at a glance. In many cases the best way of learning is by copying parts of the code, modifying them, and testing if they work as you want. This is possible to do even if you don't know all features of the language.
For example, in the snippet above, it seems to test the currently active Draft tool; if it finds a match it displays one menu, otherwise, it displays a different menu. Maybe you can try different things with different tools (square, circle, rectangle, line, etc.), and see how it works.
I have one more question. I am not sure what is the context menu. Is it the one in the picture bellow?
Re: Draft Edit improvements
That's what we call the task panel.
The context menu is exactly as you thought initially, a right click menu.
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 thanks , I will experiment with the context menu to see how much I can figure out.vocx wrote: ↑Mon Oct 14, 2019 10:26 pmThat's what we call the task panel.
The context menu is exactly as you thought initially, a right click menu.
Re: Draft Edit improvements
Also 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.
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.