maxscript 自动衣柜代码

delete geometry
wd=2400
sd=580
gd=2640
bj=18
ms=6  --门板数量

mbkd=(2400-bj-bj)/ms-2 --门板宽度

dib=box width:(wd-36) length:(sd-bj) height:bj  --底板
move dib[0,-bj/2,60]
dib.wirecolor=[0,0,255]

cbL=box width:bj length:sd height:(gd-60) --左侧板
cbl.pos=[-(wd/2-bj/2),0,0]
move cbl[0,-18,0]

cbr=copy cbl   --右侧板
move cbr[wd-18,0,0]

gtf=copy cbl   --顶封板中
gtf.height=60
gtf.width=wd
gtf.length=bj
move gtf[0,(-sd/2)+9,0]
move gtf[wd/2-9,0,(cbl.height)]

gtfL=copy cbL  --顶封板左
gtfL.height=60
gtfL.length=sd-18
move gtfL[0,9,cbl.height]
gtfR=copy gtfL  --顶封板右
move gtfL[wd-bj,0,0]

tjb=copy dib  --踢脚板
tjb.height=60
tjb.length=bj
tjb.wirecolor=[255,0,255]
move tjb[0,-(sd/2-24),-60]

zgb=copy dib  --中隔板
zgb.height=bj
move zgb[0,0,(cbl.height-60-bj-550-bj)]
zgb.wirecolor=[255,255,0]

xgb=copy zgb  --下隔板
move xgb[0,0,(-(cbl.height-bj*3-60-550)/2)]

dingb=copy zgb  --顶板
dingb.pos=zgb.pos
dingb.length=sd
move dingb[0,-bj/2,550+bj]
dingb.wirecolor=[255,5,5]

zsb=copy cbL   --中竖板
zsb.length=zgb.length
zsb.height=gd-60-bj-60-bj
if ms==6 then (    --六门
	kd=((zgb.width)/3-bj/2)+15
	move zsb[kd,9,(60+bj)]
	zsb2=copy zsb
	move zsb2[kd,0,0]
	)
				--四门
if ms==4 then (
	move zsb[((wd-bj*2)/2-bj/2)+18,9,(60+bj)]
	)
	
beib=box width:wd length:sd height:gd  --背板
beib.width=wd-36
beib.height=gd-60
beib.length=5
move beib[0,(sd/2-15.5),0]

select #(dib,cbl,cbr,beib,tjb,zsb,dingb,zgb,zsb2,gtfl,gtfr,gtf,xgb)  --选择集
$.wirecolor=[100,100,100]	
Group selection 	
--------------------------------------------------	
xmb0=box length:18 width:390 height:(gd-18-550-60-60-7)   --下门板
xmb0.pos=[0,0,0]
move xmb0[(-wd/2+390/2)+18,-292,60]
a=xmb0.pos
xmb0.height
a.y;a.x
smb0=copy xmb0    --上门板
smb0.height=550+16
move smb0[0,0,xmb0.height+4]
selectmore xmb0
b=smb0.pos
b.y;b.x
select xmb0
selectmore smb0

for i=1 to (ms-1) do
	(
	a.x+=mbkd+2
	b.x+=mbkd+2
	xmb=instance xmb0
	xmb.pos=[a.x,a.y,a.z]
	selectmore xmb
	smb="smb"+(i as string)	
	smb=instance smb0
	smb.pos=[b.x,b.y,b.z]
	selectmore smb	
	)
-- $.wirecolor=[200,100,200]
	
-- if $zmb then box()
-- Group selection name:"zmb"
Group selection  

	
 select $group001
	
	aaa=box()
-- 	aaa.name="good"
-- 	
-- 	select $good
	
-- 	
-- 	try 
-- 	(
-- 		$group008=undefined
-- 		print "没有"
-- 	)catch(
-- 		print "有"
-- 		
-- 		)
-- 	if $group001==undefined then (print "没有")
	
-- 	if isValidNode aaa do print "对象存在" else print "对象不存在"
	
	if $group002 == undefined then print "对象不存在"
		else print "对象存在"
		
-- 	if $group001==ok then 
-- 	(	messageBox("bbb"))
-- 	select geometry
	
-- 	select #($zmb,$guiti)	
-- 	Group selection name:"yigui"
	

-- select $box*
--  convertToPoly $	
-- addmodifier $ (Chamfer amount:2 segments:2 smooth:on smoothtype:1 smoothtoadjacent:on )
-- 	mybox.name = "BlueBox"
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值