Improved object library with preview
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Improved object library with preview
Improved object library with preview
I do not use the object library as much as I would like because it has some limitations. So some ideas I had:
- 3D preview: when an item in the library is selected it is opened in a separate window and the view is split (something similar is done with the Alignement tool). So the user can still see the main window and quickly edit or just look at the model he wants to insert. The model could also be inserted with link in this way. If another file is selected the old file is closed and the one is opened.
- the library should be more flexible, in a way like a file browser, so users can open any file they want(similar how it is done in Rhino 3D)
- save in file: if a user models a chair for example a save button could exist in the library pannel and when it is pressed the file is saved in a folder which is opened in the library.
It could look similar to the image below.
I do not use the object library as much as I would like because it has some limitations. So some ideas I had:
- 3D preview: when an item in the library is selected it is opened in a separate window and the view is split (something similar is done with the Alignement tool). So the user can still see the main window and quickly edit or just look at the model he wants to insert. The model could also be inserted with link in this way. If another file is selected the old file is closed and the one is opened.
- the library should be more flexible, in a way like a file browser, so users can open any file they want(similar how it is done in Rhino 3D)
- save in file: if a user models a chair for example a save button could exist in the library pannel and when it is pressed the file is saved in a folder which is opened in the library.
It could look similar to the image below.
Re: Improved object library with preview
I started doing some simple changes to the library just to see what changes could be implemented. I managed to add a simple Viewer document(it is just a basic document which opens and closes each time an object in the library is clicked). In this way it would serve as a 3D preview before importing the object into the main file.
My next goal is to split the view when the Viewer is opened, so that the user can see both the Viewer and the document they have been working on.
I have one question, is there some command to select all files in a document and then to delete them all?
Bellow is the modified Parts Library macro, if someone would try it out and tell me what they think about the idea I would appreciate it.
My next goal is to split the view when the Viewer is opened, so that the user can see both the Viewer and the document they have been working on.
I have one question, is there some command to select all files in a document and then to delete them all?
Bellow is the modified Parts Library macro, if someone would try it out and tell me what they think about the idea I would appreciate it.
- Attachments
-
- PartsLibrary Improved1.FCMacro
- (19.85 KiB) Downloaded 43 times
Re: Improved object library with preview
You have a tool for Select all: https://wiki.freecadweb.org/Std_SelectAllABeton wrote: ↑Sat May 01, 2021 9:39 pm I started doing some simple changes to the library just to see what changes could be implemented. I managed to add a simple Viewer document(it is just a basic document which opens and closes each time an object in the library is clicked). In this way it would serve as a 3D preview before importing the object into the main file.
My next goal is to split the view when the Viewer is opened, so that the user can see both the Viewer and the document they have been working on.
I have one question, is there some command to select all files in a document and then to delete them all?
Bellow is the modified Parts Library macro, if someone would try it out and tell me what they think about the idea I would appreciate it.
and one for delete: https://wiki.freecadweb.org/Std_Delete
I tested your macro and it works. I think your idea is good.
- I would suggest the Viewer window should be optional (a check box for "Show preview").
- Also, the viewer should show the model in isometric, rather than top view (there are many 2D objects).
- What about a new option of the object in the library to be inserted as AppLink?
- Also, a easy way in the Library panel, to create new folders?
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)
Canal Youtube Grupo Telegram de FreeCAD Español
My personal web site
My GitHub repository
Mini Airflow Tunnel Project
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)
Canal Youtube Grupo Telegram de FreeCAD Español
My personal web site
My GitHub repository
Mini Airflow Tunnel Project
Re: Improved object library with preview
Awesome development and contribution to FreeCAD / Arch-BIM !
I just re-visit Parts-Library Add-on in FreeCAD, not very handy to install, but find there is a small Preview there
Look forward to your development !
Thanks !
Re: Improved object library with preview
Thanks, I forgot about those commands. The problem is when I use the Delete command it often asks me do I want to delete some objects which is annoying. A more elegant way is to create a new viewer file each time I think for this reason.bitacovir wrote: ↑Sun May 02, 2021 12:17 amYou have a tool for Select all: https://wiki.freecadweb.org/Std_SelectAllABeton wrote: ↑Sat May 01, 2021 9:39 pm I started doing some simple changes to the library just to see what changes could be implemented. I managed to add a simple Viewer document(it is just a basic document which opens and closes each time an object in the library is clicked). In this way it would serve as a 3D preview before importing the object into the main file.
My next goal is to split the view when the Viewer is opened, so that the user can see both the Viewer and the document they have been working on.
I have one question, is there some command to select all files in a document and then to delete them all?
Bellow is the modified Parts Library macro, if someone would try it out and tell me what they think about the idea I would appreciate it.
and one for delete: https://wiki.freecadweb.org/Std_Delete
I tested your macro and it works. I think your idea is good.
- I would suggest the Viewer window should be optional (a check box for "Show preview").
- Also, the viewer should show the model in isometric, rather than top view (there are many 2D objects).
- What about a new option of the object in the library to be inserted as AppLink?
- Also, a easy way in the Library panel, to create new folders?
- Yes I agree on it being optional.
- I tried implementing isometric view, perhaps it looks a bit strange how it zooms onto the items. You can try it out and see.
- I added a button for Linking now in the options, but am having problems to get the command working
- Create new folders is a good idea, I will try to figure it out
Thank you Yes, having the command in the form of macro is not optimal. Is there some reason why the Object library in BIM workbench and this macro are different?
And on my computer the small Preview almost never works for some reason. That is why I wanted to make a viewer, every time I import five chairs just to find the one I want
Re: Improved object library with preview
ABeton wrote: ↑Sun May 02, 2021 2:39 pm Thank you Yes, having the command in the form of macro is not optimal. Is there some reason why the Object library in BIM workbench and this macro are different?
And on my computer the small Preview almost never works for some reason. That is why I wanted to make a viewer, every time I import five chairs just to find the one I want
Very seldom use BIM wb, not to mention the Object Library
The Preview of the Parts-library indeed only works on a small portion, no idea about the reason...
Re: Improved object library with preview
That is interesting, what do you use for architecture if not BIM workbench? BIM workbench is really good, just needs some polishpaullee wrote: ↑Sun May 02, 2021 4:17 pmABeton wrote: ↑Sun May 02, 2021 2:39 pm Thank you Yes, having the command in the form of macro is not optimal. Is there some reason why the Object library in BIM workbench and this macro are different?
And on my computer the small Preview almost never works for some reason. That is why I wanted to make a viewer, every time I import five chairs just to find the one I want
Very seldom use BIM wb, not to mention the Object Library
The Preview of the Parts-library indeed only works on a small portion, no idea about the reason...
Re: Improved object library with preview
Ahh ok, there is not so much difference anyway, most of the tools are the same BIM only has some interesting features added.
Re: Improved object library with preview
I continued working on this a bit, and a lot of things work quite well now. Also I made all of the changes in the BIM object library, not the macro one.
Things that I added:
One thing that I would really like to get to work is the Online mode. It would really be cool to get models in that way. For now it is not working and I get this error:
I checked the code, and I saw that it is reffering to "OfflineLibrary.py", but this file does not exist. So I am not sure what should the "OfflineLibrary.py" file contain. Sorry to bother you but could you give me some advice on this?
To try the changes out it is necessary to put the file attached bellow, to the place where the BIM folder is and replace the existing "BimLibrary.py" file. First do a backup of course. If this i not the propper way to share and test code please let me know, because I don't know any better at the moment
Things that I added:
- there is a separate Viewer file where you can see the files you want to import or link
- when you click on a FreeCAD file it just opens it(works like a preview)
- you can select objects it the viewer file and link them to the main file
- the main file is the one from which you opened the command first
- you can also insert files into the main file, just open an object you like and press insert
- I also coppied the option to save a file from the macro, so you can quickly save anything in the library
One thing that I would really like to get to work is the Online mode. It would really be cool to get models in that way. For now it is not working and I get this error:
Code: Select all
"No structure in cache. Please refresh."
yorik wrote: Ping
To try the changes out it is necessary to put the file attached bellow, to the place where the BIM folder is and replace the existing "BimLibrary.py" file. First do a backup of course. If this i not the propper way to share and test code please let me know, because I don't know any better at the moment
- Attachments
-
- BimLibrary.py
- (29.21 KiB) Downloaded 30 times