Custom Pipe Support Python Script Wierdness

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I created a custom python script for a variable pipe shoe. Which works well, except for the fact that the shoe is being placed perpendicular to the pipe. And I can't change its orientation.........because when I attempt to rotate the shoe the Z Axis is actually called from the connecting pipe.
This is the script:
import aqa.math
import math
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.custom import *
@Anonymous(Group="Support", TooltipShort="APA SH01 Pipe Shoe Variable", TooltipLong="APA SH01 Pipe Shoe Variable", LengthUnit="mm",Ports="1")
@matthias_hein("MainDimensions")
@param(L1=LENGTH, TooltipShort="Shoe Pad Length", TooltipLong="Shoe Pad Length", Ask4Dist=True)
@param(A1=LENGTH, TooltipShort="Shoe Pad Width", TooltipLong="Shoe Pad Width")
@param(T1=LENGTH, TooltipShort="Shoe Pad Thickness", TooltipLong="Shoe Pad Thickness")
@param(L2=LENGTH, TooltipShort="Shoe Web Length", TooltipLong="Shoe Web Length")
@param(H1=LENGTH, TooltipShort="Shoe Web Thickness", TooltipLong="Shoe Web Thickness")
@param(B=LENGTH, TooltipShort="Shoe Web Height", TooltipLong="Shoe Web Height")
@param(P1=LENGTH, TooltipShort="Main Piperun Diameter", TooltipLong="Main Piperun Diameter")
@matthias_hein(Name="meaningless enum")
@enum(1, "align X")
@enum(2, "align Y")
@enum(3, "align Z")
#--------------------------------------------------------
#(arxload "PnP3dACPAdapter")
#(TESTACPSCRIPT "APASH01" "L1" "300" "A1" "140" "T1" "10" "L2" "300" "H1" "10" "B" "100" "P1" "114")
def APASH01(s, L1 = 300.0, A1 = 140.0, T1 = 10.0, L2 = 300.00, H1 = 10.0, B = 100.0, P1 = 114.3, ID = 'APASH01', **kw):
# create the shoe flange
# o1 = BOX(s, L=L1, W=A1, H=T1).rotateY(90).translate((0.0, 0.0, - T1 / 2.0))
BOX(s, L=L1, W=A1, H=T1).rotateY(90).rotateZ(90).translate((0.0, 0.0, - T1 / 2.0))
#--------------------------------------------------------
# create the shoe web
# o2 = BOX(s, L=L2, W=B, H=H1)
shoeheight = B - H1
inspoint = shoeheight + (P1/2)
BOX(s, L=L2, W=shoeheight, H=H1).rotateY(0).rotateZ(90).translate((0.0, 0.0, shoeheight / 2.0))
# o1.unitWith(o2)
# o2.erase()
s.setPoint((0.0, 0.0, inspoint), (-1.0, 0.0, 0.0))
And here is what happens. Shoe in the red box has been placed from the Pipe Support Palette (Script based).
The Cyan coloured shoe was created using the Testacpscript (found in the script body above).
I've never had this or seen this before. Has anyone seen this behaviour or know of a solution.
Cheers,
Steve