i suspect that you work in an industrial environment. i work with companies with up to 50 employees and around 10-20 cad workstationsuser1234 wrote: ↑Tue Nov 16, 2021 8:14 pm Yes that i heard this often. Then you get an other ERP system, which can not handle this sort of "table" and so you must edit 100000+ per hand, also have seen this. This is not about the empirical datas, this is about to maintain the datas!
Greetings
user1234
[solved] "All"-File management / database with text files in the directory tree for linux
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
here is the first part. a macro to create a data sheet
/home/pc50/.FreeCAD/mds.sh
https://www.youtube.com/watch?v=7q2b1WVXHyI
Code: Select all
import subprocess
import shlex
import FreeCAD as app
import PySide
from PySide import QtCore, QtGui
from PySide.QtGui import QLineEdit, QRadioButton
global filename
try:
filename, filefilter = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(), 'Open An asc File', '*.FCStd')
except Exception:
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")# macro path
path = param.GetString("MacroPath","") + "/" # macro path
filename, filefilter = PySide.QtGui.QFileDialog.getOpenFileName(None, "asc File", path, "*.FCStd")
datei = open('/tmp/textdatei.txt','w')
datei.write(filename)
datei.close()
subprocess.call('/home/pc50/.FreeCAD/mds.sh')
FreeCAD.openDocument(filename)
/home/pc50/.FreeCAD/mds.sh
Code: Select all
#!/bin/bash
value=$(</tmp/textdatei.txt)
cp /home/pc50/.FreeCAD/vorlage.txt $value".txt"
gedit $value".txt"
https://www.youtube.com/watch?v=7q2b1WVXHyI
Re: File management / database with text files in the directory tree for linux
That is not easy to answer, yes this sounds odd. Partially, so yes and no. But my former employer has the same issue and struggle with that a lot and have not more than 100 employees. The also had to change due license their system. They also said, minimum effort, because the old stuff is good (which indeed is). But they forget, that they have to maintain the datas for a good implementation in an ERP system, which can change processes over the time. And in lack of a good database, the had to make a 6 count number to edit, while there are many drawing and processes in there. Also firm in the near of me had the indent issue. So when i hear PDM and ERP system change, i hear all alarm bells ringing.thomas-neemann wrote: ↑Tue Nov 16, 2021 8:17 pm i suspect that you work in an industrial environment. i work with companies with up to 50 employees and around 10-20 cad workstations
Greetings
user1234
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
It is very easy to automate an import with text files as they are created here
Re: File management / database with text files in the directory tree for linux
Not when they have issues like not uniformed name (which can happen over the years), different datatypes, datetypes, UTF-8 vs. ISO-8859-1 vs. ASCII fields (which are not marked as any kind of type), text position swaps, different line ends, ⌀ vs. ∅ vs. Ø vs. ø vs. ⊘, ...... and that in only one type of part. In a database you have also sometimes variation, but can force at least some sort of uniformation, that when you are searching result, you get all valid results.
Greetings
user1234
Greetings
user1234
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: File management / database with text files in the directory tree for linux
With this version it is possible to manage, find and edit "all" data types.
drawings, parts lists, emails pdf etc
mds.sh is unchanged
https://www.youtube.com/watch?v=xZkW16DLxtY
drawings, parts lists, emails pdf etc
Code: Select all
import subprocess
import shlex
import FreeCAD as app
import PySide
from PySide import QtCore, QtGui
from PySide.QtGui import QLineEdit, QRadioButton
global filename
try:
filename, filefilter = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(), 'Open An File', '*.*')
except Exception:
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")# macro path
path = param.GetString("MacroPath","") + "/" # macro path
filename, filefilter = PySide.QtGui.QFileDialog.getOpenFileName(None, " File", path, "*.*")
datei = open('/tmp/textdatei.txt','w')
datei.write(filename)
datei.close()
subprocess.call('/home/pc50/.FreeCAD/mds.sh')
mds.sh is unchanged
https://www.youtube.com/watch?v=xZkW16DLxtY
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: "All"-File management / database with text files in the directory tree for linux
here the final version with automatic $ HOME recognition.
everything in one piece with template and shell script, please copy your own configuration before use in order to restore the original state if necessary
everything in one piece with template and shell script, please copy your own configuration before use in order to restore the original state if necessary
Code: Select all
subprocess.call(os.environ['HOME']+'/.FreeCAD/mds.sh')
Re: [solved] "All"-File management / database with text files in the directory tree for linux
@thomas-neeman maybe using home like that and hardcoding ~/.FreeCAD is not what you want for "long term stability", as some changes are to be integrated
see: https://forum.freecadweb.org/viewtopic.php?f=9&t=63648
A little not complete resume:
It is true that current version are not affected, but this change would modify standard location in favour of the XDG system, so at a first glance all the file that are in ~/.FreeCAD will be go in ~/.config/FreeCAD and related directories.
Regards
Carlo D.
see: https://forum.freecadweb.org/viewtopic.php?f=9&t=63648
A little not complete resume:
....This mainly affects Linux users where config and data files are no longer written to $HOME/.FreeCAD. Instead config files now go to $HOME/.config/FreeCAD, data files go to $HOME/.local/share/FreeCAD and temporary files go to $HOME/.cache/FreeCAD/Cache. The latter were written to /tmp in the past and thus got deleted after a reboot. So, now they will survive a reboot.
Ideally there is nothing to change at all if the AddonManager uses the suitable functions. These are App.getUserAppDataDir() that returns $HOME/.local/share/FreeCAD and a special function for macros App.getUserMacroDir(True).
The user is allowed to configure the macro path and that's why True should be passed to App.getUserMacroDir() to read the user setting. If you don't pass an argument or False App.getUserMacroDir() returns the default path $HOME/.FreeCAD/Macro.
The only new function is App.getUserConfigDir() that returns $HOME/.config/FreeCAD and there we store user.cfg, system.cfg and FreeCAD.conf (created by Qt's QSettings class).
It is true that current version are not affected, but this change would modify standard location in favour of the XDG system, so at a first glance all the file that are in ~/.FreeCAD will be go in ~/.config/FreeCAD and related directories.
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- thomas-neemann
- Veteran
- Posts: 11801
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: [solved] "All"-File management / database with text files in the directory tree for linux
thanks for the hint, i hadn't read that. i will consider it in the future
Re: [solved] "All"-File management / database with text files in the directory tree for linux
Read also my question, https://forum.freecadweb.org/viewtopic. ... 41#p547541
I hope that my question will be taken in account, as thing like this could make the difference in a scenario like you reported in this post.
Regards
Carlo D.
I hope that my question will be taken in account, as thing like this could make the difference in a scenario like you reported in this post.
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/