全球FlexSim系统仿真中文论坛
标题:
如何实现一个发生器产生三种形状不同的产品
[打印本页]
作者:
小妤学仿真
时间:
2022-11-24 15:43
标题:
如何实现一个发生器产生三种形状不同的产品
产生三种产品的形状不相同应该怎么实现
作者:
小赵同学
时间:
2022-11-25 09:08
可以使用setobjectshapeindex()语句实现
作者:
小妤学仿真
时间:
2022-11-25 21:28
小赵同学 发表于 2022-11-25 09:08
可以使用setobjectshapeindex()语句实现
这个括号里的格式怎么写
作者:
zorsite
时间:
2022-11-26 11:45
触发中有现成的代码,稍微修改一下就可以用。
[attach]6011[/attach]
/**Change 3D Shape*/
Array shapename=["fs3d\\General\\Box.3ds","fs3d\\General\\Cylinder.3ds","fs3d\\General\\Sphere.3ds"];
Array size=[[0.61,0.61,0.3],[0.7,0.7,0.8],[0.5,0.5,0.5]];
double theindex = duniform(1,3);
//Get the size of the item
double x = size[theindex][1];
double y = size[theindex][2];
double z = size[theindex][3];
//Change 3D Shape
sets(shape(item),shapename[theindex]);
setobjectshapeindex(item,theindex);
//Update the item size
applyshapefactors(item);
setsize(item, x, y, z);
//Set item Type and color
item.Type=theindex;
item.color=Color.byNumber(theindex);
复制代码
欢迎光临 全球FlexSim系统仿真中文论坛 (http://www.flexsimasia.com/)
Powered by Discuz! X3.3