编程语言
首页 > 编程语言> > 上垂直三通(槽式)『AutoCAD Plant 3D Python Script』

上垂直三通(槽式)『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))

标签:Plant,AutoCAD,varmain,param,LENGTH,import,槽式,TooltipLong
来源: https://blog.csdn.net/eric0115li/article/details/121034927