几何尺寸与公差论坛

 找回密码
 注册
查看: 767|回复: 0

【转帖】how to get property from data card template form

[复制链接]
发表于 2009-4-12 21:18:22 | 显示全部楼层 |阅读模式
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 08:49 , Processed in 0.035490 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表