Please, help me!
There's a simple script:
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'CustomScripts')) from aqa.math import * from varmain.primitiv import * from varmain.custom import * @activate(Group="Support", TooltipShort="Test script", TooltipLong="This is a custom Testscript", LengthUnit="in") @group("MainDimensions") @param(aL=LENGTH, TooltipLong="Length of the Cylinder") def TEST1(s, aL=75.0, ID='P_ACTUATOR_008', **kw): aL=float(raw_input("Input text")) print "You have been enter:" print (aL)
Look here:
Please see my command line log :
Команда: (arxload "PnP3dACPAdapter.arx")
"PnP3dACPAdapter.arx"
Команда: (TESTACPSCRIPT "TEST1")
Input text78
You have been enter:
78.0
<Имя объекта: 7ffff705c00>
Команда: (TESTACPSCRIPT "TEST1")
<Имя объекта: 7ffff705c20>
As you can see, my friends, when script was executed in the next time in the same session, it keeps aL value.
When we now execute _PURGE command, script will be executed correctly.
How to modify my script???
The scripts are meant to create geometry (i.e. a block). To avoid regenerating the same block all the time, Plant 3D first looks up the block table if it already has a block that matches the script parameters. If such a block exists, it will just use it, and not invoke the script.
It looks like in this case, each block shall be unique. I haven’t tried it, but (TESTACPSCRIPT "…" "__unique__" "1") will probably do what is wanted. It will create an anonymous block instead of a block that hashes the parameters.