Object description field

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
lemonbug
Posts: 289
Joined: Sun Oct 19, 2014 5:12 pm

Object description field

Postby lemonbug » Sun Aug 30, 2015 10:25 pm

Is there a text field where I can write some notes about an object? My project keeps getting bigger and I stop working on it for long periods of time. It would be nice if I could click on the object and read any notes that I jotted down.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Object description field

Postby triplus » Mon Aug 31, 2015 12:33 am

lemonbug wrote:Is there a text field where I can write some notes about an object? My project keeps getting bigger and I stop working on it for long periods of time. It would be nice if I could click on the object and read any notes that I jotted down.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
I think there is no such feature available ATM.

P.S. What you could do is you could add spreadsheet (in first column add object name and in second column notes related to it).
mario52
Posts: 3235
Joined: Wed May 16, 2012 2:13 pm

Re: Object description field

Postby mario52 » Mon Aug 31, 2015 9:38 am

hi
This is a great easy function to build ex :
add one property in alls objects (quick example on a modified macro)

Code: Select all

      obj.addProperty("App::PropertyString","Memo","Draft","Font name").Memo = "tyty"
Memo00.png
Memo00.png (14.66 KiB) Viewed 1945 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
lemonbug
Posts: 289
Joined: Sun Oct 19, 2014 5:12 pm

Re: Object description field

Postby lemonbug » Mon Aug 31, 2015 3:49 pm

Thanks. I am not at home right now. Would I be able to use this macro to add this field? that would be awesome.
mario52
Posts: 3235
Joined: Wed May 16, 2012 2:13 pm

Re: Object description field

Postby mario52 » Tue Sep 01, 2015 1:20 pm

hi
no is just an example i add :

Code: Select all

      obj.addProperty("App::PropertyString","Memo","Draft","Font name").Memo = "tyty"
the original macro Macro_Rectellipse
you can make a feature request, this a nice feature
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
mario52
Posts: 3235
Joined: Wed May 16, 2012 2:13 pm

Re: Object description field

Postby mario52 » Wed Sep 02, 2015 7:10 pm

hi
I modified the Draft.py file:
I added these lines

Code: Select all

        obj.addProperty("App::PropertyString","_Author","Draft","Author name")
        obj.addProperty("App::PropertyString","_Date","Draft","Date")
        obj.addProperty("App::PropertyString","_Memo","Draft","Memo")
go to C:\Program Files\FreeCAD 0.15\Mod\Draft copy your original file (for as backup) an unzip and copy my file modified in your directory

for test !!
Draft.zip
(42.99 KiB) Downloaded 41 times
OS: Windows 8
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git) same version you
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Memo01.png
Memo01.png (21.01 KiB) Viewed 1848 times
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
lemonbug
Posts: 289
Joined: Sun Oct 19, 2014 5:12 pm

Re: Object description field

Postby lemonbug » Wed Sep 02, 2015 7:57 pm

ill play around with it. thanks!
mario52
Posts: 3235
Joined: Wed May 16, 2012 2:13 pm

Re: Object description field

Postby mario52 » Thu Sep 03, 2015 1:55 pm

hi
it does not work ?
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.
chrisb
Posts: 29060
Joined: Tue Mar 17, 2015 9:14 am

Re: Object description field

Postby chrisb » Fri Sep 04, 2015 9:57 pm

I just used the code given here for a similar task in the Path WB.

Select an object in the tree to the left and execute the following code:

Code: Select all

obj = FreeCADGui.Selection.getSelection()[0]
obj.addProperty("App::PropertyString","GComment","Draft","Font name").GComment = "Comment here"
App.activeDocument().recompute()
Then you have an additional field in the object GComment.
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
mario52
Posts: 3235
Joined: Wed May 16, 2012 2:13 pm

Re: Object description field

Postby mario52 » Mon Sep 28, 2015 9:53 am

Hi chrisb
i add your code in Code_snippets
thanks
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting, Dialog creation. My macros on Gist.github.