Custom Scripts Python Memory

Custom Scripts Python Memory

renan.saura
Participant Participant
1,235 Views
3 Replies
Message 1 of 4

Custom Scripts Python Memory

renan.saura
Participant
Participant

Estou criando alguns suportes no Platn3D usando Python, porém quando faço o teste do script com algum parâmetro ele fica armazenado em algum cache ou memória do AutoCAD que nao sei como limpar. Mesmo se eu mexer no script e testar denovo com os mesmos valores de parâmetro vem sempre o primeiro modelo testado. 

Alguém sabe como limpar essa memória/cache dos script Pyhton?

0 Likes
Accepted solutions (1)
1,236 Views
3 Replies
Replies (3)
Message 2 of 4

h_eger
Mentor
Mentor

Unfortunately you have to execute (PLANTREGISTERCUSTOMSCRIPTS) after every change in your Python script and then close and restart Plant 3D.
It's not nice, but it doesn't work differently with the update of the Python scrips.

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes
Message 3 of 4

renan.saura
Participant
Participant

Obrigado pela resposta, eu faço esse procedimento toda vez que altero o script, mesmo assim quando eu faço o teste do script com os mesmos parâmetros o modelo criado é sempre o mesmo. É como se ficasse armazenado em algum memória ou cache. Existe algum PURGE para Python?

 

Message 4 of 4

h_eger
Mentor
Mentor
Accepted solution

Setting up a Testing Environment
The following three tools can be placed on a tool palette for easy access and use.
Use this command macro to load the adapter we need:

^C^C(arxload "PnP3dACPAdapter.arx");

 

Use this command macro to register the scripts we wrote with Plant:

^C^C(arxload "PnP3DAcpadapter.arx");PLANTREGISTERCUSTOMSCRIPTS;

 

Use this command macro to register scripts and re-start Plant:

^C^CPLANTREGISTERCUSTOMSCRIPTS;(startapp "C:/Program Files/Autodesk/AutoCAD Plant 3D 2021 - English/acad.exe");QUIT


For each script you need to test, create another tool palette button and use this macro:

^C^C(TESTACPSCRIPT "YOUR SCRIPT")


The part in parentheses “YOUR SCRIPT” should be replaced with your script name.
With our development environment setup, you should be able to register the scripts and test our YOUR SCRIPT.py.

 

All information in RED must be replaced by your values!

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature