Yorik's Parts Library UI...

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Joel_graff
Posts: 784
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Yorik's Parts Library UI...

Postby Joel_graff » Fri Jan 11, 2019 2:00 pm

So, I've been refactoring Yorik's Parts LIbrary UI for my purposes and I really like how it's put together. At first, I wanted to handle my library by putting all of the objects in a single file, but the approach of creating a separate file for each part is much more user-friendly, in my mind...

That said, I don't know if anyone else has interest in a generic library / template manager UI, but I was thinking perhaps this ought to live as a separate thing... Besides, I've been working on genericizing the code a little bit as I've adapted it for my use (it's just my habit to code that way, I guess), so I could continue to develop it as a separate Python component, if it makes sense to do so.

Pinging Yorik for good measure. :)
yorik wrote: ping
User avatar
yorik
Site Admin
Posts: 10451
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Yorik's Parts Library UI...

Postby yorik » Mon Jan 14, 2019 2:54 pm

Great!

Have a look at the BIM Library tool too that I'm putting together: https://github.com/yorikvanhavre/BIM_Wo ... Library.py It has a system so you can click and place objects...

About library objects being a new py object type, I am not sure... What is interesting is that people can design objects that are highly parametric (ex. based on sketches, etc..) and the interesting thing is to be able to use these objects the way they were designed. By encapsulating them into a further object type might not be what you want is some cases... Why are you actually interested in doing that way?
Joel_graff
Posts: 784
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Yorik's Parts Library UI...

Postby Joel_graff » Mon Jan 14, 2019 6:01 pm

yorik wrote:
Mon Jan 14, 2019 2:54 pm
About library objects being a new py object type, I am not sure...
...
Why are you actually interested in doing that way?
I don't want a new pyobject, only to consider adding FCLib as a valid file type. Really, the idea is to designate the file as containing models / data which is not intended to be complete on it's own, but rather as support for other documents, however it may be used.

So, if I have a file that's an FCLib file, there's absolutely no difference between it and FCStd, it's just a convention that tells me it has models / sketches that I find generally helpful / useful in other projects. It's a library of frequently-used models / data. Nothing more. Really, it suggests that the models contained within aren't intended to serve as anything useful on their own, and really only serve as a supporting library for a production model.

Bentley actually uses that convention for DGN's. There's the DGN file, then DGNLIB files which are DGN's but named differently just to indicate the way the data they contain gets used. It's purely a user-level naming convention and should have zero effect on any other code in FreeCAD.
Joel_graff
Posts: 784
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Yorik's Parts Library UI...

Postby Joel_graff » Mon Jan 14, 2019 6:02 pm

yorik wrote:
Mon Jan 14, 2019 2:54 pm
Great!

Have a look at the BIM Library tool too that I'm putting together: https://github.com/yorikvanhavre/BIM_Wo ... Library.py It has a system so you can click and place objects...
I will.

I've modified the parts library widget to allow for opening a file in FreeCAD for editing, improved the save function a bit, and added the ability to add folders as well as delete files / folders (and their trees). I haven't touched the git functionality, but I love that it's there. :)
Joel_graff
Posts: 784
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Yorik's Parts Library UI...

Postby Joel_graff » Mon Jan 14, 2019 9:11 pm

yorik wrote:
Mon Jan 14, 2019 2:54 pm
Have a look at the BIM Library tool too that I'm putting together: https://github.com/yorikvanhavre/BIM_Wo ... Library.py It has a system so you can click and place objects...
So I installed the BIM WB and tried to open th eobjects library, but nothing happens. Am I missing something? No errors that I could see...
User avatar
yorik
Site Admin
Posts: 10451
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Yorik's Parts Library UI...

Postby yorik » Mon Jan 14, 2019 9:52 pm

Joel_graff wrote:
Mon Jan 14, 2019 6:01 pm
I don't want a new pyobject, only to consider adding FCLib as a valid file type. Really, the idea is to designate the file as containing models / data which is not intended to be complete on it's own, but rather as support for other documents, however it may be used.
Yes that's not a bad idea, the FC* file naming system is there exactly for that...
Joel_graff wrote:
Mon Jan 14, 2019 9:11 pm
So I installed the BIM WB and tried to open th eobjects library, but nothing happens. Am I missing something? No errors that I could see...
Indeed some BIM tools still lack some user feedback :oops: Probably the parts library is not found... basically 1) it checks the User parameter:Plugins/parts_library/destination parameter for the library path (which is normally set when you run the current parts library macro), and 2) if that setting is not set, it searches the .FreeCAD/Mod directory, where the addons manager install its stuff.
Joel_graff
Posts: 784
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Yorik's Parts Library UI...

Postby Joel_graff » Mon Jan 14, 2019 11:08 pm

yorik wrote:
Mon Jan 14, 2019 9:52 pm
ndeed some BIM tools still lack some user feedback :oops: Probably the parts library is not found...
Got it working on my linux system. Will check my Win7 system tomorrow. Parts may not be installed on that...

I like the drag / drop. It's a nice improvement. :)