[Frage] PythonParts Learning. Folders configuration

Schlagworte:
  • PythonParts Learning

Hi
In lesson 1, different proposals for creating folders appear, I attach screenshots. In which folders should the PYP and PY files be? Because the speaker's configuration does not match mine.

Anhänge (3)

Typ: image/jpeg
31-mal heruntergeladen
Größe: 221,49 KiB
Typ: image/jpeg
24-mal heruntergeladen
Größe: 110,09 KiB
Typ: image/jpeg
24-mal heruntergeladen
Größe: 50,07 KiB

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Hi Javier,

You can save your PYP files under:

  • X:\Data\Allplan\##your_allplan_version##\Std\Library\
  • X:\Data\Allplan\##your_allplan_version##\Prj\##name_of_your_project##\Library\
  • X:\Users\##your_username##\Documents\Nemetschek\Allplan\##your_allplan_version##\Usr\Local\Library\ <--- only in Allplan 2025 or newer!!!

And the PY files can be saved under:

  • X:\Data\Allplan\##your_allplan_version##\Std\PythonPartsScripts\
  • X:\Data\Allplan\##your_allplan_version##\Prj\##name_of_your_project##\PythonPartsScripts\
  • X:\Users\##your_username##\Documents\Nemetschek\Allplan\##your_allplan_version##\Usr\Local\PythonPartsScripts\ <--- only in Allplan 2025 or newer!!!

Please mind the following:

  • The names between ## are only placeholders! E.g. replace ##your_allplan_version## with 2023, 2024, etc...
  • So is the drive letter X. ON your PC it will probably be C or some other.
  • Depending on your configuration, what comes before Usr, Std or Prj might be different than in my examples.
  • When you are using the workgroup manager, the "Local" folder might in your case be the user name.
  • We recommend you to save PYP and PYs in corresponding locations, for example: when pyp is in Std/Library..., the py should be in Std/PythonPartsScripts...

Hope that helps.

Best,
Bart

Hi Javier,

You can save your PYP files under:

  • X:\Data\Allplan\##your_allplan_version##\Std\Library\
  • X:\Data\Allplan\##your_allplan_version##\Prj\##name_of_your_project##\Library\
  • X:\Users\##your_username##\Documents\Nemetschek\Allplan\##your_allplan_version##\Usr\Local\Library\ <--- only in Allplan 2025 or newer!!!

And the PY files can be saved under:

  • X:\Data\Allplan\##your_allplan_version##\Std\PythonPartsScripts\
  • X:\Data\Allplan\##your_allplan_version##\Prj\##name_of_your_project##\PythonPartsScripts\
  • X:\Users\##your_username##\Documents\Nemetschek\Allplan\##your_allplan_version##\Usr\Local\PythonPartsScripts\ <--- only in Allplan 2025 or newer!!!

Please mind the following:

  • The names between ## are only placeholders! E.g. replace ##your_allplan_version## with 2023, 2024, etc...
  • So is the drive letter X. ON your PC it will probably be C or some other.
  • Depending on your configuration, what comes before Usr, Std or Prj might be different than in my examples.
  • When you are using the workgroup manager, the "Local" folder might in your case be the user name.
  • We recommend you to save PYP and PYs in corresponding locations, for example: when pyp is in Std/Library..., the py should be in Std/PythonPartsScripts...

Hope that helps.

Best,
Bart

Thanks Bart

I have manually configured the location of the files; I have also modified the address where to find the PY in the PYP, so it works correctly.

I have incorporated into the VS Code workspace the folder where the PYP is located. I can't find a way to attach the folder where the PY is located:
- C:\Data\Allplan\....\Std\PythonPartsScripts\

Javier

Hmm, maybe I don't understand the question, but to add a folder into the workspace in VS-Code, you need to go to File -> Add Folder to Workspace
Alternatively (this is what I prefer) modify the .code-workspace file directly and create a new entry under the "folders" section. The reason, why I prefer the second option, is because I can define a custom name under which the folder appears in VS-Code and I can define both relative and absolute path.

    "folders": [
        {
            "name": "My PythonPart scripts",
            "path": "C:/Data/Allplan/...Std/PythonPartsScripts"
        },
        ...
    ]

Note, that you have to use slashes (not a backslash) and no trailing slash.

Does that helps?
Best,
Bart

Thank you very much
Solved. Your help has been very useful

One question. I don't know why it always looks for the xxxx_spa.xml file

String table error:

Filename C:\Data\Allplan\Allplan 2024\Std\Library\PythonParts\Learning\SimplePythonPart_spa.xml does not exist

Zitiert von: JavierRevilla
I don't know why it always looks for the xxxx_spa.xml file

String table error:
Filename C:\Data\Allplan\Allplan 2024\Std\Library\PythonParts\Learning\SimplePythonPart_spa.xml does not exist

Hi Javier,
The PythonParts framework is always looking for a string table with localized string resources. We describe it more deeply in this article (for Allplan 2024) or in
this article (for Allplan 2025). But if the file is not provided, nothing bad will happen.

Best,
Bart