def part1
x0 = 3.0
y0 = 0.0
i = 7
command
wall delete walls range id = @i
end_command
loop while 1 # 0
if out_coal = 1 then
i = i + 3
if i > 24 then
exit
endif
x21 = x00
x22 = x11
wallid = i - 3
x0 = x0 + 4.5
out_coal = 0
fname = string.build('%1_picture.png',i)
command
wall delete walls range id = @i
wall create id @wallid vertices @x21 @y0 @x22 @y0
plot bitmap plot 'Plot01' filename @fname
end_command
else
command
cyc 100
end_command
endif
end_loop
end
在这里贴出来一个程序,简单的看一下如何通过程序输出图片,而不是一张一张的去截图。
本程序首先定义的是一个无限循环的过程,loop while 1 # 0,就是一个无限循环的过程,在其中我们可以设置一些条件跳出循环;
输出图片之前,我们需要定义图片的名称的,也就是字符串构建命令string.build;
plot bitmap plot 'Plot01' filename @fname,即为输出图片的命令,Plot01表示的是选取的视图。