Here is the code , It works fine when it works locally
import aqa.math
import math
from varmain.primitiv import *
from varmain.custom import *
@Anonymous(Group="Support", Ports="1", TooltipShort="Pipe Clamp", TooltipLong="Pipe Clamp with threaded rod", LengthUnit="mm")
@group("MainDimensions")
@param(D=LENGTH, TooltipShort="Inside diameter of pipe support. (Matches the Pipe diameter)", TooltipLong="Inside diameter of pipe support. (Matches the Pipe diameter)")
@param(L=LENGTH, TooltipShort="Length of the clamp", TooltipLong="Length of the clamp")
@param(W=LENGTH, TooltipShort="Thickness of the clamp", TooltipLong="Thickness of the clamp")
@param(K=LENGTH, TooltipShort="Overall width of the clamp. If set to 0 we use D+(L*2)", TooltipLong="Overall width of the clamp. If set to 0 we use D+(L*2)")
@param(M1=LENGTH, TooltipShort="thread rod diameter", TooltipLong="thread rod diameter")
@param(H=LENGTH, TooltipShort="Distance from clamp center to thread end", TooltipLong="Distance from clamp center to thread end")
@group(Name="meaningless enum")
@enum(1, "align X")
@enum(2, "align Y")
@enum(3, "align Z")
def OSPC001(s, D=116.0, L=30.0, W=4.0, K=0.0, M1=10.0, H=150.0, ID = 'OSPC001', **kw):
#Calculation
R1 = (D / 2.0)
R2 = (R1 + W)
if (K <= 0.0):K = (D + (L * 2.0))
CSW=(M1*1.5)
KWdt = float(CSW * math.tan(aqa.math.asRadiants(30.0)))
BH=(K-D-(2*W))/4
BL=(W*7)
#Create Clamp
o1 = CYLINDER(s, R=R2, H=L, O=0.0).translate((0, 0, -(L / 2.0)))
o2 = BOX(s, L=K, W=L, H=(W * 3.0))
o3 = CYLINDER(s, R=R1, H=L, O=0.0).translate((0, 0, -(L / 2.0)))
o4 = BOX(s, L=K, W=L, H=W)
#create rod
o5=CYLINDER(s, R=M1/2, H=H-R2-M1, O=0.0).translate((0,0,R2+M1)).rotateY(90)
#Unite
o1.uniteWith(o2)
o2.erase()
o1.uniteWith(o5)
o5.erase()
o3.uniteWith(o4)
o4.erase()
o1.subtractFrom(o3)
o3.erase()
#Rotate
o1.rotateY(90)
#Create Clamp Bolts
oB1=CYLINDER(s, R=(L/6), H=BL, O=0.0).translate((0, BH+R2, -(BL / 2.0)))
oB2=CYLINDER(s, R=(L/6), H=BL, O=0.0).translate((0, -(BH+R2), -(BL / 2.0)))
#create clamp nut bottom
oN1 = BOX(s, L=CSW, W=M1, H=KWdt).translate((0, 0, -M1/2-R2))
oN2 = BOX(s, L=CSW, W=M1, H=KWdt).translate((0, 0, -M1/2-R2)).rotateZ(60.0)
oN3 = BOX(s, L=CSW, W=M1, H=KWdt).translate((0, 0, -M1/2-R2)).rotateZ(-60.0)
#Unite
oN1.uniteWith(oN2)
oN2.erase()
oN1.uniteWith(oN3)
oN3.erase()
o1.uniteWith(oN1)
oN1.erase()
o1.uniteWith(oB1)
oB1.erase()
o1.uniteWith(oB2)
oB2.erase()
#Connection Points
s.setPoint((0, 0, 0), (-1, 0, 0))
s.setLinearDimension('H', (0, 0, 0), (0, 0, -H))