heda wrote: ↑Tue Oct 04, 2022 4:32 pm
...
Hello, this is the result of the test code on my 0.20.1 AppImage.
Code: Select all
import os
>>> os.listdir(App.getUserMacroDir(True))
[]
>>>
So probably there is something different across versions.
But it depends, as I'm using an AppIMage and using a different user directory for each version and language of FC I have installed, so probably it is my side that is "strange".
This is what I have in the "User macro location" using my "custom user directory".
The code I've posted is the code I use when dealing with scripting that has to import "libraries" in other word "collections of methods" that I use to do modelling.
So it is working, as I use it in my "strange environment" every day.
But is Linux, so on Windows I could not be sure at 100%.
Code: Select all
OS: Artix Linux (openbox)
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: Italian/Italy (it_IT)
Installed mods:
* Assembly4 0.12.4
* toSketch 1.0.1
* Curves 0.5.8
FC has not modified the import mechanism, there is a layer of abstraction, as the interpreter is running "inside FC" but usually the only drawback is that when dealing with WB as example is difficult to circumvent the "cache mechanism" so if you change sources sometimes they are not reloaded even if you use the importlib hack.
Kind Regards
Carlo D.