Chinese forum

## 你是哪类工程师？

2
50%

0

0

0

1
25%

0

1
25%

QiZhenHua
Posts: 1
Joined: Sat Jul 18, 2020 3:46 am

### 参数化栈板设计及装载模拟

Code: Select all

``````def makebox(doc,boxname,length,width,height,x,y,z):
doc.recompute()
box.Length,box.Width,box.Height = length, width, height

Code: Select all

``````def makepallet(name,x,y,z,dx,xn,dy,yn,dz):
if xn < 1 : i=1
else:		i=xn
while i>0:
if yn < 1 :	j=1
else:		j=yn
while j>0:
makebox(name+str(i)+str(j),x,y,z,dx*(i-1),dy*(j-1),dz)
j -= 1
i -= 1 ``````

Code: Select all

``````list_title=["Pallet Length(PX)",
"Pallet Width(PY)",
"Pallet Height",
"Support Length",
"Support Width",
"Panel Width",
"Quantity of Panel",
"Quantity of Bridge",
"Quantity of Bottom"]
list_data=[1200,1000,120,12,90,90,100,5,3,3 ]
L_pallet        = list_data[0]
W_pallet 	= list_data[1]
H_pallet	= list_data[2]
T_wood		= list_data[3]
L_support 	= list_data[4]
W_support 	= list_data[5]
W_panel 	= list_data[6]
n_panel 	= list_data[7]
n_bridge 	= list_data[8]
n_bottom 	= list_data[9]
``````

Code: Select all

``````list_bottom =[n_bottom,L_pallet,W_support,T_wood]
list_support=[int(n_bottom*n_bridge),L_support,
W_support,H_pallet-3*T_wood]
list_bridge =[n_bridge,L_support,W_pallet,T_wood]
list_panel  =[n_panel,L_pallet,W_panel,T_wood]``````

Code: Select all

``````mylist=list_bottom
makepallet("bottom",mylist[1],mylist[2],mylist[3],
0,0,(W_pallet-mylist[2])/(n_bottom-1),
n_bottom,0)
mylist=list_support
makepallet("support",mylist[1],mylist[2],mylist[3],
(L_pallet-mylist[1])/(n_bridge-1),
n_bridge,
(W_pallet-mylist[2])/(n_bottom-1),
n_bottom,
list_bottom[3])
mylist=list_bridge
makepallet("bridge",mylist[1],mylist[2],mylist[3],
(L_pallet-mylist[1])/(n_bridge-1),
n_bridge,
0,0,
list_bottom[3]+list_support[3])
mylist=list_panel
makepallet("panel",mylist[1],mylist[2],mylist[3],
0,0,
(W_pallet-mylist[2])/(n_panel-1) ,
n_panel,
list_bottom[3]+list_support[3]+list_bridge[3])
``````

pallet.FCMacro
Last edited by QiZhenHua on Sun Aug 02, 2020 7:05 am, edited 1 time in total.

paullee
Posts: 2989
Joined: Wed May 04, 2016 3:58 pm

### Re: 参数化栈板设计及装载模拟

Posts: 1
Joined: Thu Jul 23, 2020 6:16 am

### Re: 参数化栈板设计及装载模拟

QiZhenHua wrote:
Sat Jul 18, 2020 5:24 am

Code: Select all

``````def makebox(doc,boxname,length,width,height,x,y,z):
doc.recompute()
box.Length,box.Width,box.Height = length, width, height

Code: Select all

``````def makepallet(name,x,y,z,dx,xn,dy,yn,dz):
if xn < 1 : i=1
else:		i=xn
while i>0:
if yn < 1 :	j=1
else:		j=yn
while j>0:
makebox(name+str(i)+str(j),x,y,z,dx*(i-1),dy*(j-1),dz)
j -= 1
i -= 1 ``````

Code: Select all

``````list_title=["Pallet Length(PX)",
"Pallet Width(PY)",
"Pallet Height",
"Support Length",
"Support Width",
"Panel Width",
"Quantity of Panel",
"Quantity of Bridge",
"Quantity of Bottom"]
list_data=[1200,1000,120,12,90,90,100,5,3,3 ]
L_pallet        = list_data[0]
W_pallet 	= list_data[1]
H_pallet	= list_data[2]
T_wood		= list_data[3]
L_support 	= list_data[4]
W_support 	= list_data[5]
W_panel 	= list_data[6]
n_panel 	= list_data[7]
n_bridge 	= list_data[8]
n_bottom 	= list_data[9]
``````

Code: Select all

``````list_bottom =[n_bottom,L_pallet,W_support,T_wood]
list_support=[int(n_bottom*n_bridge),L_support,
W_support,H_pallet-3*T_wood]
list_bridge =[n_bridge,L_support,W_pallet,T_wood]
list_panel  =[n_panel,L_pallet,W_panel,T_wood]``````

Code: Select all

``````mylist=list_bottom
makepallet("bottom",mylist[1],mylist[2],mylist[3],
0,0,(W_pallet-mylist[2])/(n_bottom-1),
n_bottom,0)
mylist=list_support
makepallet("support",mylist[1],mylist[2],mylist[3],
(L_pallet-mylist[1])/(n_bridge-1),
n_bridge,
(W_pallet-mylist[2])/(n_bottom-1),
n_bottom,
list_bottom[3])
mylist=list_bridge
makepallet("bridge",mylist[1],mylist[2],mylist[3],
(L_pallet-mylist[1])/(n_bridge-1),
n_bridge,
0,0,
list_bottom[3]+list_support[3])
mylist=list_panel
makepallet("panel",mylist[1],mylist[2],mylist[3],
0,0,
(W_pallet-mylist[2])/(n_panel-1) ,
n_panel,
list_bottom[3]+list_support[3]+list_bridge[3])
``````

pallet.FCMacro

felixlee868
Posts: 60
Joined: Wed Jul 03, 2019 8:15 am

### Re: 参数化栈板设计及装载模拟

johnwang
Posts: 587
Joined: Sun Jan 27, 2019 12:41 am

### Re: 参数化栈板设计及装载模拟

felixlee868 wrote:
Wed Jul 29, 2020 3:26 pm

pallet.jpg (48.11 KiB) Viewed 16426 times
pallet and goods.jpg (31.47 KiB) Viewed 16426 times

paullee
Posts: 2989
Joined: Wed May 04, 2016 3:58 pm

### Re: 参数化栈板设计及装载模拟

Wow! 看來很好 !

felixlee868
Posts: 60
Joined: Wed Jul 03, 2019 8:15 am

### Re: 参数化栈板设计及装载模拟

paullee
Posts: 2989
Joined: Wed May 04, 2016 3:58 pm

### Re: 参数化栈板设计及装载模拟

felixlee868 wrote:
Fri Aug 07, 2020 11:18 am

johnwang wrote: Ping