Standard support converts to python script

Standard support converts to python script

DominicNelson_Mathalaimuthu
Contributor Contributor
854 Views
8 Replies
Message 1 of 9

Standard support converts to python script

DominicNelson_Mathalaimuthu
Contributor
Contributor

If any possibility to convert standard support into python script in AutoCAD plant3d

 

0 Likes
Accepted solutions (2)
855 Views
8 Replies
Replies (8)
Message 2 of 9

h_eger
Mentor
Mentor

yes

-

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 9

DominicNelson_Mathalaimuthu
Contributor
Contributor

Hi Hartmut Eger

 how to convert standard support into python script could you please explain the method

0 Likes
Message 4 of 9

h_eger
Mentor
Mentor

@DominicNelson_Mathalaimuthu 

 

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.

-

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 5 of 9

DominicNelson_Mathalaimuthu
Contributor
Contributor

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.

0 Likes
Message 6 of 9

h_eger
Mentor
Mentor

@DominicNelson_Mathalaimuthu ,

 

which Python version are you using in AutoCAD Plant 3D?

-

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 7 of 9

DominicNelson_Mathalaimuthu
Contributor
Contributor

Hi

 

 AutoCAD plant3D 2022 version
Python script software not used

0 Likes
Message 8 of 9

h_eger
Mentor
Mentor
Accepted solution

@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.

-

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 9 of 9

ken.fauver
Advocate
Advocate
Accepted solution

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.