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


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


 
 
主题工具 搜索本主题 显示模式
旧 2009-04-12, 06:57 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】mass email of messages from msmq 9pdmworks workgroup0

mass email of messages from msmq (pdmworks workgroup)
hello,
our company is in process of implementing pdmworks workgroup in our system. we have setup the triggers as well as msmq service and everything is functioning correctly.
we would like to know if there's a sample script (or how we would go about writing one), to read xml messages from the queue, and e-mail them to whomever.
we've done some research on this subject, where most relevant result was regarding msmq exchange connector, but this is only applicable up to windows nt (we're using 2003)
any help is greatly appreciated,
vedran ikonic
edited: 06/27/2008 at 04:04 pm by vedran ikonic
i wouldn't like to leave this thread in the dust,
i just wanted to say i was able to come up with the code that will retrieve messages, extract needed data, store them in an html doc that will be e-mailed at a later date.
if someone needs help with this, let me know.
thanks
hi
i would very much like to see the script you have wrritten.
i'm just about to try and do exactly what you have done.
i want to to work on revision change but there isn't a simple trigger have you any suggestions.
thanks
john sutton
you should be able to monitor the "modifycustomproperty". when it is the revision custom property that has changed, do something.
wayne matus
texas engineering systems
thanks
i'll give it a try as soon as i can. busy with drawings at the mo.
i too could do with a 'crash course' in the use of workgroup triggers. our it department has just installed the msmq on the server (and we've turned it on in valutadmin), but i don't know how to pick up the xml messages - where are they?
a few sample bits of vb would be really useful. can i still do it in vb6 (i don't really have time for a .net upgrade at the moment). this would be most useful as if i can't notifiy a particular set of users when documents are up-issued, pdmww is practically dead in the water.
thanks very much for your help.
simon, here is a link to some samples in vb6.
i must say that solidworks documentation on triggers is a bit lacking probably a lot you really need to understand msmq and a programming language to understand it. but i've got this far and seeing what i could now use triggers for it was worth the effort.
private sub monitorqueue() handles timer.tick
count = count + 1 'count of polling the queue
txtcounter.text = count.tostring
dim queue as new messagequeue()
queue.path = ".\private$\pdmworks"
queue.formatter = new activexmessageformatter 'use this for solidworks
dim qenum as messageenumerator
qenum = queue.getmessageenumerator2
while qenum.movenext 'read all messages
dim m as message = qenum.current
dim reader as system.xml.xmlreader = system.xml.xmlreader.create(new system.io.stringreader(m.body))
reader.readtofollowing("header")
strtype = reader.getattribute("type") ' get type of trigger
reader.readtofollowing(strtype)
strdocument = microsoft.visualbasic.ucase(reader.getattribute("document"))
strdocumentorig = microsoft.visualbasic.ucase(reader.getattribute("document"))
strrevision = microsoft.visualbasic.ucase(reader.getattribute("revision"))
struser = microsoft.visualbasic.ucase(reader.getattribute("user"))
strstatus = reader.getattribute("status")
select case strtype
case "checkin"
'messagebox.show("checkin message")
checkin()
m = queue.receive(new timespan(1000)) ' delete message comment out for debugging
case "changedocstatus"
'messagebox.show("change status message")
strstatus = reader.getattribute("new_value")
changedocstatus()
m = queue.receive(new timespan(1000)) ' delete message comment out for debugging
end select
end while
end sub
great! thanks john,
i will have a play with that in a while. i don't know why solidworks seem so reluctant to give out useful information about triggers when they are so useful and greatly extend the functionality of both/either pdm product. indeed pdm api help in general seems to have gone all naff lately.
i did a presentation at sww 2008 in san diego about programming triggers. the presentation includes a sample vb.net 2005 express edition project. i did not include one for email because i did not want to be responsible for someone hijacking your mail server, but what i have should be able to help you. if you would like a copy of it, please send me an email at wmatusattexasengineering.com.
wayne matus
texas engineering systems
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



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


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