【FlexSim】仿真模型二次开发教程笔记

FlexSim仿真建模进阶版,需要了解FlexScript脚本语言和PF模块。

前段时间完成了一个FlexSim仿真定制模型的构建,将过程中用到的脚本语句记录整理下来,希望可以帮助到感兴趣的同学。

官方文档:https://docs.flexsim.com/en/25.1/Reference/CodingInFlexSim/WritingLogic/WritingLogic.html

其中:FlexScript脚本常用语法记录如下:

  1. 数据类型:

int v1=1;
double v2=0.5;

string LineName=getvarnode(Model.find("Tools/ParameterTables/Parameters"), "parameters").as(Table).cell(17, 4).value;//开放Parameter参数,便于用户输入做自定义;

string wip_order=LineName+"/"+"WIP";

Array OP=["Operator1","Operator2","Operator3"];

treenode CheckList=Table(checklist);

Object.create("VisualTool").name=LineName;
Object obj_L=model.find(LineName);
obj_L.setSize(2,1,0.1);
obj_L.setLocation(Vec3(0,0,0),Vec3(v1,v2,v3));
obj_L.color=Color.yellow;

逻辑分支:

//2.Create Table("QueryDump") to record BOM by Station SQL Query result!
treenode QueryDump=Table("QueryDump");
if(QueryDump)
{
	//Table("QueryDump") has created!
}
else
{
	treenode QueryDump=Tools.create("GlobalTable");
	QueryDump.name="QueryDump";
}

while (current.subnodes.length > 2)
{
	current.last.destroy();
}

//create opearators
for(int i=1;i<=numOP;i++)
{
	Object.create("Operator").name=OP[i];
	Object obj = Model.find(OP[i]);
	obj.setLocation(x0-dis_L*0.5-1+0.5*i,y0+1,0);
	obj.color=Color.byNumber(i);	
	moveobject(obj,obj_L);//move to plane
		
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值