- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I've had success creating pythons scripts and implementing them in catalogs/specifications for pipe supports, but I'm having difficulty with inline components. I'm trying to create a strainer with a third port at the basket. When I test the script using the TESTACPSCRIPT function everything works correctly and the component is created at the origin. However, when I create a new component using this script and then add it to a specification I get the following error when inserting the component into Plant3D, "Can't find symbol for specified part". I used the same methodology that I used to create support components and add them to a specification. Any idea why this wouldn't work in the spec but works in the TESTACPSCRIPT? I'll add the script below and hope that helps.
# Add custom scripts folders to system path
import os
import sys
sys.path.append(os.path.normpath(sys.PnP3dNativeContentCustomScriptsPath))
# Import standard libraries
import aqa.math
import math
from varmain.primitiv import *
from varmain.var_basic import *
from varmain.custom import *
# Activate support
@Anonymous(Group="Strainer", Ports = "3", TooltipShort="Y-Strainer",TooltipLong="Y-Strainer w/ 3rd Port",LengthUnit="in")
@group("MainDimensions")
@param(ID=LENGTH,TooltipShort="INNER DIA.",TooltipLong="STRAINER INNER DIAMETER")
@param(OD1=LENGTH,TooltipShort="OUTER DIA.",TooltipLong="STRAINER OUTER DIAMETER")
@param(OD2=LENGTH,TooltipShort="FLG. OUTER DIA.",TooltipLong="FLANGE OUTER DIAMETER")
@param(TF=LENGTH,TooltipShort="FLG. THK.",TooltipLong="FLANGE THICKNESS")
@param(L=LENGTH,TooltipShort="LENGTH.",TooltipLong="STRAINER LENGTH")
@param(X=LENGTH,TooltipShort="HOR. LOC.",TooltipLong="HORIZONTAL DISTANCE FROM STRAINER INLET TO BASKET")
@param(Z=LENGTH,TooltipShort="VER. LOC.",TooltipLong="VERTICAL DISTANCE FROM STRAINER INLET TO BASEKET")
def ESY85TEST(s,ID=3.0,OD1=4.5,OD2=9.0,TF=0.875,L=12.13,X=9.0,Z=7.75,**kw):
ob1=CYLINDER(s,R=OD2/2,H=TF,O=ID/2).rotateY(90)
ob2=CYLINDER(s,R=OD1/2,H=L-2*TF,O=ID/2).rotateY(90).translate((TF,0,0))
ob1.uniteWith(ob2)
ob2=CYLINDER(s,R=OD2/2,H=TF,O=ID/2).rotateY(-90).translate((L,0,0))
ob1.uniteWith(ob2)
ob2=CYLINDER(s,R=OD1/2,H=Z*sqrt(2)-0.25,O=ID/2).rotateY(135).translate((X-Z,0,0))
ob3=CYLINDER(s,R=OD1/2,H=L).rotateY(90)
ob2.subtractFrom(ob3)
ob1.uniteWith(ob2)
ob2=CYLINDER(s,R=OD1/2,H=0.25).rotateY(-45).translate((X,0,-Z))
ob1.uniteWith(ob2)
ob2.erase()
ob3.erase()
s.setPoint((0,0,0),(-1,0,0))
s.setPoint((L,0,0),(1,0,0))
s.setPoint((X,0,-Z),(1,0,-1))
return
Solved! Go to Solution.