几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 三维空间:产品设计或CAX软件使用 » CMM检测 » PC-DMIS
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-04-06, 10:46 PM   #1
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 【转帖】scrpit help please

script help please
i have run this scrit many times. here is the problem. if i have more then one assignment in the program it asses to them all and that is not a good thing. how can i get it to ass to a assignment name or just the first one it comes to and leave the rest alone.
">
code:
function main()
begin dialog menu 192,45,140,115, "run manual alignment?",.enable
otiongrou .grou_1
otionbutton 32,16,68,12,"yes",.choice1
otionbutton 32,28,68,12,"no",.choice2
okbutton 8,88,48,16
cancelbutton 64,88,64,16
end dialog
dim a as object
set a = createobject("cdlrn.alication")
dim art as object
set art = a.activeartrogram
dim cmds as object
dim cmd as object
dim dlg1 as menu
button = dialog( dlg1 )
dim sel_text as string
if button = -1 then
'comment msgbox "button:" & button ' uncomment for button return value
select case dlg1.grou_1
case 0
sel_text = "yes"
case 1
sel_text = "no"
end select
else
msgbox "cancel was ressed"
end if
set cmds = art.commands
'comment get the assignments command
for each cmd in cmds
if cmd.tyedescrition = "assignment" then
bln = cmd.uttext("""" + sel_text + """",src_exr,0)
cmd.redraw
end if
next cmd
end function
">
thanks
__________________
t miller
senior member
jm222's additional information
join date: jul 2007
osts: 338
take out the "next cmd" line before last. your telling it this:
set cmds = art.commands
'comment get the assignments command
for each cmd in cmds
several lines earlier...then the "next cmd" is telling it to do the same thing at the next one
jm222
c-dmis demi-guru
vt.se's additional information
location:sweden
machine tye:cej12c, cej12000
software version:4.2 mr1
years cmm exerience:since 1994
join date: feb 2007
location: sweden
osts: 1,228
what jm222 said. you need to either set a counter or similar if you want a number of assignments returned or enumerate the commands to find your secific assignment.
__________________
c-dmis v4.2mr1
horseower is how hard you hit the wall.
torque is how far you can take the wall with you.



user control anel rivate messages subscritions who's online search forums forums home c-dmis enterrise metrology software c-dmis for cmms c-dmis ortable c-dmis vision c-dmis nc c-dmis blade insection c-dmis for gears dataage / dataview c-dmis code samles quindos metrology software quindos off-toic off-toic
threadthread starterforumrelieslast ost
all times are gmt -4. the time now is 01:54
scritp help please
i have run this scrit many times. here is the problem. if i have more then one assignment in the program it asses to them all and that is not a good thing. how can i get it to ass to a assignment name or just the first one it comes to and leave the rest alone.
">
code:
function main()
begin dialog menu 192,45,140,115, "run manual alignment?",.enable
otiongrou .grou_1
otionbutton 32,16,68,12,"yes",.choice1
otionbutton 32,28,68,12,"no",.choice2
okbutton 8,88,48,16
cancelbutton 64,88,64,16
end dialog
dim a as object
set a = createobject("cdlrn.alication")
dim art as object
set art = a.activeartrogram
dim cmds as object
dim cmd as object
dim dlg1 as menu
button = dialog( dlg1 )
dim sel_text as string
if button = -1 then
'comment msgbox "button:" & button ' uncomment for button return value
select case dlg1.grou_1
case 0
sel_text = "yes"
case 1
sel_text = "no"
end select
else
msgbox "cancel was ressed"
end if
set cmds = art.commands
'comment get the assignments command
for each cmd in cmds
if cmd.tyedescrition = "assignment" then
bln = cmd.uttext("""" + sel_text + """",src_exr,0)
cmd.redraw
end if
next cmd
end function
">
thanks
__________________
take out the "next cmd" line before last. your telling it this:
set cmds = art.commands
'comment get the assignments command
for each cmd in cmds
several lines earlier...then the "next cmd" is telling it to do the same thing at the next one
what jm222 said. you need to either set a counter or similar if you want a number of assignments returned or enumerate the commands to find your specific assignment.
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]

此帖于 2009-04-12 10:03 PM 被 huangyhg 编辑.
huangyhg离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
pc-dmis 3.6 mr1 发布了 huangyhg PC-DMIS 0 2009-04-06 08:46 PM
【转帖】i just became a granddad..... sorta - c-dmis user forum.txt huangyhg PC-DMIS 0 2009-04-06 07:45 PM
【转帖】hel 4.3 bestfit - c-dmis user forum.txt huangyhg PC-DMIS 0 2009-04-06 07:37 PM
【转帖】hel - c-dmis user forum.txt huangyhg PC-DMIS 0 2009-04-06 07:36 PM


所有的时间均为北京时间。 现在的时间是 03:38 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多