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))
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
Any idea what's wrong here?
Do I need to import any library to use decimal values?
Thanks for the help
Solved! Go to Solution.
Solved by jabowabo. Go to Solution.
This is related to regional settings changing the decimal separator from period to comma. These links may help:
https://learn.microsoft.com/en-us/archive/msdn-technet-forums/355326dd-5ee6-4015-8649-749175b0610d
https://www.howtogeek.com/245510/how-to-change-excels-decimal-separators-from-periods-to-commas/
Can't find what you're looking for? Ask the community or share your knowledge.