Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
If any possibility to convert standard support into python script in AutoCAD plant3d
Solved! Go to Solution.
If any possibility to convert standard support into python script in AutoCAD plant3d
Solved! Go to Solution.
yes
Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn
Hi Hartmut Eger
how to convert standard support into python script could you please explain the method
Sure. If you get into the habit of posting complete information here, we'll be able to formulate complete answers.
Am I Jesus with holes in my hands and moss between my toes so I can walk on water and read your thoughts?
No, I can't, so please provide all the information.
Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn
Hi Hartmut Eger,
I have standard support in AutoCAD plant 3d, but I want this standard support to convert into python script if it possible please give me a procedure.
@DominicNelson_Mathalaimuthu ,
which Python version are you using in AutoCAD Plant 3D?
Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn
Hi
AutoCAD plant3D 2022 version
Python script software not used
@DominicNelson_Mathalaimuthu ,
However, in AutoCAD Plant 3D 2022, you are using Python version 3.7.
Starting with AutoCAD Plant 3D 2025, you will use Python version 3.11.
A basic piece of information regarding Python scripting in AutoCAD Plant 3D: the included Python scripts cannot be used to create custom Python scripts for AutoCAD Plant 3D.
Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn
You can use the included Python scripts to create new ones. You have to convert back down to its source (.py) or download the source files (use to be on the ADN site), then rename the source file, rename the def (python function in source) to match the new file name, strip some info out like the activate () info, similar to this:
activate(CPFW,
"""
[Type AQA-VCPFW]
VID=STRING,32
DN=STRING
L=LENGTH
B=LENGTH
D1=LENGTH
D2=LENGTH
D3=LENGTH
Units=STRING,8
;
uniqId=CALC =$self.VID$ $self.DN$
;
boltCalcVal=CALC CPF_GetNeededBoltParam(B=self.B.value(), L=self.L.value())
;
@key=VID,DN
""",
"@VarDataDefault0",
)
Then add this reference:
from varmain.custom import *
Then add the @ parameters like it says in the documentation I have attached.
The script should register properly now. Happy scripting.