- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello.
I'm trying to create a T-shaped support using Python code.
The code I wrote is as follows, and it appears in the Spec Editor, but when inserting an item, the message "Geometry can not be generated with the given parameters."
It is written with the error "Can't find symbol for specified part."
Can someone please check what I'm doing wrong in my code?
from math import *
from varmain.primitiv import *
from varmain.custom import *
@Anonymous(Group="Support", Ports="1", TooltipShort="Tbar", TooltipLong="This is a Custom T Support", LengthUnit="in")
@group("MainDimensions")
@Anonymous(C1=LENGTH, TooltipShort="Width Frame")
@Anonymous(C2=LENGTH, TooltipShort="Middle Frame Height")
@Anonymous(C3=LENGTH, TooltipShort="Frame Thickness C3")
@Anonymous(C4=LENGTH, TooltipShort="Frame Thickness C4")
@Anonymous(C5=LENGTH, TooltipShort="Length")
@Anonymous(D=LENGTH, TooltipShort="Pipe Diameter")
def Tbar(s, C1=4, C2=4, C3=0.125, C4=0.12, C5=8, D=2.5, **kw):
# MISC BOX
# o0 = BOX(s, L=1, H=1, W=1)
# Support itself
o1 = BOX(s, L=C5, W=C1, H=C3).translate(0, 0, -D/2)
o2 = BOX(s, L=C5, W=C4, H=C2).translate(0, 0, -((D/2) - C3)).rotateX(90)
# Unite the components
o1.uniteWith(o2)
o2.erase()
# Set a reference point
s.setPoint((0, 0, 0), (1, 0, 0))
Solved! Go to Solution.