- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm new to Python scripting and recently wrote a script for a Structure TeePost. After spending many hours on it, I managed to get most of it working correctly. However, I'm facing an issue with the parametric stretch—it’s not functioning as expected.
I've attached a video demonstrating the problem. Could you please take a look and help me resolve this?
Thanks in advance for your support!
"
from varmain.primitiv import *
from varmain.custom import *
@activate(Group="Support", Ports="1", TooltipShort="HEA100 Beam", TooltipLong="HEA100 I-Beam with Rotation Option", LengthUnit="mm")
@group("MainDimensions")
@param(D=LENGTH, TooltipShort="Pipe dia")
#@param(SS=LENGTH, TooltipShort="STRING")
@param(h=LENGTH, TooltipShort="Section height")
@param(b=LENGTH, TooltipShort="Flange width")
@param(tw=LENGTH, TooltipShort="Web thickness")
@param(tf=LENGTH, TooltipShort="Flange thickness")
@param(L1=LENGTH, TooltipShort="Beam length1")
@param(L2=LENGTH, TooltipShort="Beam length2")
@group("Options")
@param(A1=LENGTH, TooltipShort="Height")
@param(A2=LENGTH, TooltipShort="Breadth")
@param(T1=LENGTH, TooltipShort="Top thickness")
#(TESTACPSCRIPT "HEA100")
def HEA100(s, D=116.0, h=80.0, b=100.0, tw=5.0, tf=8.0, L1=1000.0, L2=500.0, rotY=1, A1=150.0, A2=200.0, T1=12.0, ID='HEA100 Beam', **kw):
# Bottom flange
Flange1 = BOX(s, L=(L1-(tf+T1)), W=b, H=tf)
Flange1.rotateX(90)
Flange1.translate((0.0,0.0,2.0))
Flange2 = BOX(s, L=(L1-(tf+T1)), W=b, H=tf)
Flange2.translate(((h+tf),0.0,0.0))
Flange2.rotateX(90)
Flange2.translate((0.0,0.0,2.0))
web = BOX(s, L=(L1-(tf+T1)), W=tw, H=h)
web.translate(((h+tf)/2,0.0,0.0))
web.rotateX(90)
web.translate((0.0,0.0,2.0))
plate = BOX(s, L=A1, W=A2, H=T1)
plate.rotateY(90) # rotate 90° along Y-axis
plate.translate(((h+tf)/2,0.0,(0-L1/2)+(T1)/2))
Flange1A = BOX(s, L=L2, W=b, H=tf)
Flange1A.rotateZ(90)
Flange1A.rotateX(90)
Flange1A.translate(((h+tf)/2,0.0,(L1/2+tf/2)-(h+2*tf)))
Flange2A = BOX(s, L=L2, W=b, H=tf)
Flange2A.rotateZ(90)
Flange2A.rotateX(90)
Flange2A.translate(((h+tf)/2,0.0,(L1/2-tf/2)))
#Flange2A.rotateX(90)
webA = BOX(s, L=L2, W=tw, H=h)
webA.rotateY(90)
webA.rotateZ(90)
webA.translate(((h+tf)/2,0.0,(L1/2)-(h/2+tf)))
#OD=CYLINDER(s, R=D/2, H=0.5, O=D/2-.1)
#OD.rotateX(90)
#OD.translate(((h+tf)/2, 0,(L1/2)+D/2))
#SS = (L1/2+T1)
s.setPoint((((h+tf)/2, 0.0,(L1/2)+D/2)), (0.0, -1.0, 0.0))
s.setLinearDimension('L1', (0, 0, 0), (0, 0, -L1))"
Solved! Go to Solution.