About PDM for FreeCAD

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: About PDM for FreeCAD

Post by dan-miel »

grd wrote: Mon Nov 14, 2022 8:31 pm If you want to help, you are welcome.
I think I’m getting to old to dedicate my time to a project this big but I have read some of the information in your links and a have written some thoughts below.
Renaming FreeCAD file extensions would be unnecessary but you need to write programs to detect different assembly files.
I think you are over thinking attributes, these are usually determined by each user or company. The main ones you would need to worry about is file ID and location.
IMO a PDM that is setup with projects is too confining because too many files are used in multiple projects. The length of file names are moot, because smaller companies are liable to use names before they move to numbers but a way of checking the file names to insure that they meet the companies standards might be important.
Attributes are normally stored in files and transferred to the PDM when the file is added to PDM, you also need to be concerned about an attribute being changed in PDM and the file being updated to match.
Different companies change revisions for different reasons some change them for fixing typos others don’t. A user changeable workflow is probably more important than deciding things yourselves.
I think PDM should be separate from FreeCAD. It may require a separate PDM for each type of assembly file.
Good Luck.
Dan
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: About PDM for FreeCAD

Post by grd »

@dan-miel

Thanks for your info. I appreciate that. You could help a lot, looking at your background, but I understand why you don't want to. Yes, I think that a PDM could be too much work. It takes a lot of time to get it working and to make it work professionally that takes a lot of time more.
But you understand why I wanted to split up the complexity. Unfortunately no-one wanted it to happen. It is not only the assemblies, it is the drawings too, and the parts. I don't think that we need three PDMs for the assemblies, because they mix up sooner or later anyway. No we need one and make it work. But I already mentioned the type of asemblly in the file attributes
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: About PDM for FreeCAD

Post by onekk »

grd wrote: Wed Nov 16, 2022 9:53 am ...
Problem is that using your term splitting the complexity will result in "rewriting most of FreeCAD" from scratch.

Probably a suboptimal but more feasible way is to "embed" in the file format some added informations, that tells that this file is not a "FreeCAD drawing" but something else like a "project file". See below for some ideas.

But I think this could be already done setting and retrieving some variables from the FCStd file, ar even an entire "summary file" that will contain data that could be used by the PDM.

https://wiki.freecadweb.org/File_Format_FCStd

Embedding other files

Probably if you inject some data and provided a FPO that will collect and update this data, you could state a "name-scheme" for the FCStd file, and a "project file" that will use "subassemblies" and "elements".

something maybe like:
  • A project file that will contain the Assembly - named maybe xxxx-proj.FCStd
  • Various subassembly files - named maybe xxxx-subxxx.FCstd
  • Element files (that will contain a single solid) xxxx-PN.FCstd
And probably using Links glue them together.

But you have to manage the complexity yourself, or propose maybe some "Flag" that will make FreeCAD react and maybe if a "project file" is loaded do some things, like check relations between objects and check if they are "correct" i.e descendig the "tree" Assembly - Subassembly - elements check if everything is correct and validate the "project".

As said in the linked page, there is a way to even embed a file in the FCstd described in:

https://forum.freecadweb.org/viewtopic.php?t=38201

Now probably the point is to have a button on the interface, (maybe an ad-hoc WB) that could be used to validate things.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: About PDM for FreeCAD

Post by dan-miel »

grd wrote: Wed Nov 16, 2022 9:53 am I don't think that we need three PDMs for the assemblies, because they mix up sooner or later anyway.
@grd
I think one of the first things is to find which file properties you want and need so I cobbled together several programs to make one. I can clean it up but this may give you something to chew on.
I am working on putting this on github but for today I’ll attach it. Unzip the file and put the FileProperties folder in your mod folder. This will give you another workbench. The icon is four ugly squares. Open any file, start the program and it will inform you that there is not a property object in the file, Do you want to insert one. Click yes and it will create a properties object with some default properties. The property name is on the left and the value is on the right. To delete a property, delete the name, then when you save and exit it will be gone. To add a property, click the Add row button and type in a Name and value. When you Save and exit it will add the property. You can also modify the properties by highlighting the gray icon in the tree and use the data tab. The properties object can be copy passed from file to file to keep properties the same. Spelling is important
The program is rough. If you added these objects to all your files it would give you one object to draw your properties from and write the database properties to. You might be able to auto link the created by and created bDate to a drawing file and autofill the fields. This is getting long so I say again it is a rough program but might give you some ideas.
The multiple PDMs were because the different assembly handles parts differently. Maybe I should have said multiple programs.
Dan
Attachments
FileProperties.zip
(96.13 KiB) Downloaded 31 times
fileproperties.JPG
fileproperties.JPG (29.92 KiB) Viewed 1182 times
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: About PDM for FreeCAD

Post by grd »

@dan-miel Thanks a lot! I think that this could help because dealing with the attributes is a pain point. The problem however is the integration with FC and that is why I always denied that part, this issue [1] and also that I don't know whether a file is open or not. Your code is built inside FC and mine is not, that means that I have to deal with saving a file and I think that can be rough too. We'll see. But I like the code, it looks good! Tomorrow I am gonna test and work with it. Both inside FC and in FreePDM.

@onekk To be honest, you lost me somewhere in what you said. I don't quite figure out what you said. But it is late.


[1] https://github.com/grd/FreePDM/issues/37
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: About PDM for FreeCAD

Post by dan-miel »

@grd
If you were able to use the first program, would you like to try another half-backed idea? This one creates a database with some of the fields from the first program and saves the inputted info to the db. If the file has a properties object from the first program the fields are filled in from the object. It has a simple search. Doesn't save the files yet. I'm still reading about the sqlite3 database.
Dan
Attachments
Database.JPG
Database.JPG (45.55 KiB) Viewed 1052 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: About PDM for FreeCAD

Post by Kunda1 »

@dan-miel very cool progress!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: About PDM for FreeCAD

Post by grd »

@dan-miel It looks good... but I wasn't able to run the program yet. How am I gonna run the program? (I feed ridiculously stupid)

Code: Select all

OS: Linux Mint 21 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: English/United States (en_US)
Installed mods: 
  * QuickMeasure 2022.10.28
  * CfdOF-master 1.20.1
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
dan-miel
Posts: 391
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: About PDM for FreeCAD

Post by dan-miel »

grd wrote: Fri Nov 18, 2022 9:51 pm @dan-miel It looks good... but I wasn't able to run the program yet. How am I gonna run the program? (I feed ridiculously stupid)
@grd
What have you tried. I thought that unzipping the fille and copying the folder to your FreeCAD/Mod folder would create a property workbench when you started or restarted FreeCAD
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: About PDM for FreeCAD

Post by grd »

@dan-miel Yes. Now it works! I was working with this Flatpak nonsense and after that with the AppImage. That works! Yes, your program works! It works rather well. I haven't seen the new program yet....

Now I have also worked with the Windows version and that works too. Very well done!
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Post Reply