AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Elbow Invalid Script parameter value:d1=66,7

1 REPLY 1
SOLVED
Reply
Message 1 of 2
abilioramos
164 Views, 1 Reply

Elbow Invalid Script parameter value:d1=66,7

Hi all Plant 3D users,

 

I'm starting my first steps on Plant 3D Python Script.

 

I have successfully creted and tested my first Script, and it works as intended on Plant 3D:

 

from aqa.math import *
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.arcsub.cpb_util import *
from varmain.custom import *

@activate(Group="Elbow", TooltipLong="Carbon Steel 90Deg Bend", TooltipShort="90Deg Bend", FirstPortEndtypes="CBMF", LengthUnit="mm", Ports="2")

@group("MainDimensions")
@param(L=LENGTH, TooltipLong="Overall Length", TooltipShort="Overall Length")
@param(A=LENGTH, TooltipLong="Insert Depth", TooltipShort="Insert Depth")
@param(d1=LENGTH, TooltipLong="Pipe Insert Diameter", TooltipShort="Pipe Insert Diameter")

def PRO_503184 (s, L=141.000, A=50.000, d1=66.700, ID="PRO_503184", **kw):
    PART01 = ARC3D (s, D=d1/2, R=(L-A)*0.72, A=90).rotateZ(-90)
    PART02 = CYLINDER(s, R=d1/2, H=(L-A)*0.28, O=0).rotateY(90).translate(((L-A)*0.72, 0, 0))
    PART03 = CYLINDER(s, R=(d1*1.25)/2, H=A, O=d1/2).rotateY(90).translate(((L-A), 0, 0))
    PART04 = CONE(s, R1=d1/2, R2=(d1*1.25)/2, H=((d1*1.25)-d1)/2, E=0).rotateY(90).translate((((L-A)-((d1*1.25)-d1)/2), 0, 0))
    PART05 = TORUS(s, R1=(d1*1.25)/2, R2=(d1*0.25)/2).rotateY(90).translate((L-(d1*0.25)/2, 0, 0))
    SUBT01 = CYLINDER(s, R=(d1*1.25)/2, H=A, O=d1/2).rotateY(90).translate(((L-A), 0, 0))
    PART06 = CYLINDER(s, R=d1/2, H=(L-A)*0.28, O=0).rotateX(90).translate((0, -(L-A)*0.72, 0))
    PART07 = CYLINDER(s, R=(d1*1.25)/2, H=A, O=d1/2).rotateX(90).translate((0, -(L-A), 0))
    PART08 = CONE(s, R1=d1/2, R2=(d1*1.25)/2, H=((d1*1.25)-d1)/2, E=0).rotateX(90).translate((0, -((L-A)-((d1*1.25)-d1)/2), 0))
    PART09 = TORUS(s, R1=(d1*1.25)/2, R2=(d1*0.25)/2).rotateX(90).translate((0, -(L-(d1*0.25/2)), 0))
    SUBT02 = CYLINDER(s, R=(d1*1.25)/2, H=A, O=d1/2).rotateX(90).translate((0, -(L-A), 0))
    PART05.subtractFrom(SUBT01)
    PART09.subtractFrom(SUBT02)
    SUBT01.erase()
    SUBT02.erase()
    s.setPoint(((L-A), 0, 0), (1, 0, 0))
    s.setPoint((0, -(L-A), 0), (0, 1, 0))
    

 

abilioramos_0-1706826645346.png

Now I'm trying to build a catalog with this script. I export the Excel file complete the values but when I try to import the excel file I get two errors:

Elbow Invalid Script parameter value:d1=66,7

Elbow Invalid Script parameter value:d1=88,9

abilioramos_1-1706827131922.png

 

Any idea what's wrong here?

Do I need to import any library to use decimal values?

 

Thanks for the help

1 REPLY 1

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report