本文主要是介绍上垂直三通(槽式)『AutoCAD Plant 3D Python Script』,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
# -*- coding: utf-8 -*-
from varmain.primitiv import *
from varmain.custom import *
@activate(Group="Tee", FirstPortEndtypes="BV, CT", Ports="3", TooltipShort="", LengthUnit="mm")
@group("MainDimensions")
@param(A=LENGTH, TooltipLong="")
@param(B=LENGTH, TooltipLong="")
@param(L=LENGTH, TooltipLong="")
def NLCTTEE_CS3TU_A(s, A=100.0, B=50.0, L=450.0, **kw):
if B<=0.0:
paB=A/2.0
else:
paB=B
pa01=paB/2.0
paL=L/2.0
pa02=paB*0.7
pa03=(L-paB)/2.0-pa02
pa04=(L+paB)/2.0
s01=BOX(s, H=L, L=paB, W=A)
s02=BOX(s, H=pa04, L=paB, W=A).rotateZ(90.0).translate((0.0, pa04/2.0-pa01, 0.0))
s01.uniteWith(s02)
s02.erase()
s101=BOX(s, H=pa03, L=pa03, W=A).translate((-pa03/2.0, pa03/2.0, 0.0))
s102=BOX(s, H=pa03*20.0, L=pa03*20.0, W=A).translate((pa03*10.0, pa03*10.0, 0.0)).rotateZ(45.0)
s101.subtractFrom(s102)
s102.erase()
s101.translate((pa03+pa01, pa01, 0.0))
s01.uniteWith(s101)
s101.erase()
s201=BOX(s, H=pa03, L=pa03, W=A).translate((-pa03/2.0, pa03/2.0, 0.0))
s202=BOX(s, H=pa03*20.0, L=pa03*20.0, W=A).translate((pa03*10.0, pa03*10.0, 0.0)).rotateZ(45.0)
s201.subtractFrom(s202)
s202.erase()
s201.translate((pa03+pa01, pa01, 0.0)).rotateZ(90.0)
s01.uniteWith(s201)
s201.erase()
s01.rotateX(-90.0)
s.setPoint((-paL, 0.0, 0.0), (-1.0, 0.0, 0.0))
s.setPoint((paL, 0.0, 0.0), (1.0, 0.0, 0.0))
s.setPoint((0.0, 0.0, -paL), (0.0, 0.0, -1.0))
这篇关于上垂直三通(槽式)『AutoCAD Plant 3D Python Script』的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!