几何尺寸与公差论坛------致力于产品几何量公差标准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:34 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】how to get property from data card template form

how to get property from data card / template form
hi all. i'm a newbie to se and need some advice.
i have a input form / template card (see attached) which is used to log internal service requests (i'm part of a var - newbie to se)
i would like to extract the "email address" which would then be used as an argument to a program i've written. this program will send out a standard notification to the client notifying them of the fact that their service request has been logged with us. sort of similar to the way solidworks notifies us of our own service requests.
but i want to integrate this in solidworks enterprise
(this email field is linked to a variable called "sr email")
is there a way to extract this variable value from the data card (or from the form template) ? also... is there a way to run a program automatically whenever i click on the okay button for the template?
i'm in the process of writing an addin, but i'm don't know how to pass arguments to the addin...
should i be using an addin or a seperate program and rather pass the variable to the outside program? if so - how do i do this?
regards and thanks in advance
...3d apps... can anyone live without them?
hmm...i don't seem to be able to attach using firefox... gonna try ie quickly...
...3d apps... can anyone live without them?
edited: 01/29/2009 at 07:18 am by andries koorzen
click for full image
firstly, whats is the form you are showing us? is that a macro in sw, an add-in, a bespoke software program, part of sw enterprise? and when you say "(this email field is linked to a variable called "sr email")", what variable are you referring to, a custom property, a database field etc...?
hi luke.
this is a template form from solidworks enterprise...i set it up so that when you right click in an enterprise window there is a menu entry that says... "new service request"
the variable i'm talking about is one of the variables in enterprise - but it is also available on the form...
in the meantime i've found a way to run an external / addin program when a file passes through a certain workflow state. what i would like to know is how to extract the variable called "sr email" from the template form / data card. i.e. what code can one use to get it?
regards
...3d apps... can anyone live without them?
i must say i have never used enterprise, i have the full partner sw 09 version but have not got around to installing it yet so not sure of the api for pdm. i will try to take a look over the weekend at pdm and see if i can find out for you.
to retrieve or set the value of a variable in pdmworks enterprise, reference the iedmenumeratorvariable5 object. i'm not sure what programming language you're using, but the help file for pdmworks should steer you in the right direction once you look that up.
hi mark. thanks i'll give it a try and keep you posted. i'm currently using visual basic .net 2005
...3d apps... can anyone live without them?
@mark
the program i've written is an outside program used to send email to a particular person.
at the moment i don't see how iedmenumeratorvariable5 will help since it has to run inside se as an add-in. i don't have a addin....mine is a standalone executable. i'll look into an addin as an option... but in the meantime... is there a way to pass a variable value to an external program?
...3d apps... can anyone live without them?
the iedmenumeratorvariable5 doesn't necessarily have to be run from an add-in. if you're using vb .net 2005 you should be able to reference the enterprise library and use iedmenumeratorvariable5 in your external app. i use vb .net express 2008 and solidworks 2007 with pdmworks enterprise 2007 and this method has worked for me.
as for passing a variable to an external app from the card, i'd say use a button on the card to execute your application, followed by a %1 to send the filename as an argument. then, inside your app you can use the environment.getcommandlineargs to read the argument you sent. with the pdm library referenced, you can use the getfilefrompath method in the iedmvault object to set the file as an iedmfile object. from there you could use the iedmenumeratorvariable5 to get the "sr email" variable value.
i can make an example and send it to you if you'd like.
answer hi mark.
an example would've been great, but i believe experience is the best way to learn so i did the coding myself... works like a charm! i used my.application.commandlineargs(0).tostring to get the path to the current file in the vault (when used in conjunction with %1 argument) instead of environmet.getcommandlineargs...different strokes for different folks i guess
oh and by the way... my mistake... i use .net express 2008 not 2005...
thanks for the feedback. iedmenumeratorvariable5 solved the problem!
...3d apps... can anyone live without them?
quick
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



所有的时间均为北京时间。 现在的时间是 01:52 PM.


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