几何尺寸与公差论坛------致力于产品几何量公差标准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, 11:17 PM   #1
huangyhg
超级版主
 
huangyhg的头像
 
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
huangyhg 向着好的方向发展
默认 vb -i tried the following code to insert three standard comments we use into programs

vb code help
hi hi
i tried the following code to insert three standard comments we use into programs, saves tying the same thing over and over again but it will only insert the comments at the end of the program and i need it to insert at the current cursor position.
what have i missed out?
">
code:
sub main
dim dmisa as object
dim dmisart as object
dim dmiscommands as object
dim dmiscommand as object
set dmisa = createobject("cdlrn.application")
set dmisart = dmisa.activepartprogram
set dmiscommands = dmispart.commands
commandcount = dmiscommands.count
set dmiscommand = dmiscommands.item(commandcount)
dmiscommands.insertionpointafter dmiscommand

set dmiscommand = dmiscommands.add(set_comment, true)
dmiscommand.marked = true
' set id = c1
retval = dmiscommand.uttext ("c1", id, 0)
' set comment tye = inut
retval = dmiscommand.settogglestring (3, comment_tye, 0)
' set comment item 1 = 'works order no'
retval = dmiscommand.uttext ("works order no", comment_field, 1)
' set reort = yes
retval = dmiscommand.settogglestring (2, outut_tye, 0)

set dmiscommand = dmiscommands.add(set_comment, true)
dmiscommand.marked = true
' set id = c2
retval = dmiscommand.uttext ("c2", id, 0)
' set comment tye = inut
retval = dmiscommand.settogglestring (3, comment_tye, 0)
' set comment item 1 = 'customers order no'
retval = dmiscommand.puttext ("customers order no", comment_field, 1)
' set report = yes
retval = dmiscommand.settogglestring (2, outut_tye, 0)

set dmiscommand = dmiscommands.add(set_comment, true)
dmiscommand.marked = true
' set id = c3
retval = dmiscommand.uttext ("c3", id, 0)
' set comment tye = inut
retval = dmiscommand.settogglestring (3, comment_tye, 0)
' set comment item 1 = 'serial no & date'
retval = dmiscommand.puttext ("serial no & date", comment_field, 1)
' set report = yes
retval = dmiscommand.settogglestring (2, outut_tye, 0)

end sub

pc-dmis cad++ 4.2 mr1
dea mistral
look at you "insertionpointafter" second block...last line
__________________
借用达朗贝尔的名言:前进吧,你会得到信心!
[url="http://www.dimcax.com"]几何尺寸与公差标准[/url]

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


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】sorry still need help huangyhg PC-DMIS 0 2009-04-06 10:48 PM
【转帖】scrpit help please huangyhg PC-DMIS 0 2009-04-06 10:46 PM
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


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


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