This content has been marked as final. Show 13 replies
What type of document is your ECN and what information are you wanting pulled from the drawing?
You can use Dispatch to create an action to copy a template file from one location to another.. I do this for checklists. When a user submits a drawing for approval I copy a template Word checklist from a template folder into the same folder as the drawing being submitted for approval and I push it through the workflow to the "Waiting approval" stage.
You're supposed to be able to read/write from PDM variables and Microsoft Office files, there is some information in the admin guide for it, but I haven't tried doing that yet. So you might take a peek there and read the Dispatch guide that comes with your PDM installation in the Support folder on the CD and you should find what you need.
I'm making some good headway with Dispatch. Do you know of a way to have Dispatch modify a variable in Enterprise? For example, I'm using Dispatch to create a copy of a part with a difference filename. I'd like to also update the part number variable for the selected file, but I can't seem to find a way to do this.
I don't know of a way using Dispatch to write to a variable... but it's a really simple little program to put together in VB and then you can kick off that program as an add-in with Dispatch.
Do you have Visual Studio, or can you download Visual Studio Express (free version)?
Nope, haven't ventured into making my own add-in yet.
I would suggest going ahead and grabbing the free version of Visual Studio. Dispatch can handle some basic actions, but you'll be able to do much much more with vb.net add-ins, and they're really not all that hard to put together. Especially if you grab:
That little add-in template is a life-saver!!
The only other way that I know of to write to a variable on a data card is with workflow transition actions... would that work in your case? I think it's called update variable or something to that effect when you're in the transition action editor in your workflow. That's going to update the variable on the card of the file going through that transition... so I'm not sure if that'll work for you or not.
I think the workflow method will work.
Ok... I think it's pretty straightforward, and there's some documentation in the Admin guide for PDM on how to set transition actions... but if you get stuck on it, just let me know and I'll try to explain how to set it up a little more thoroughly.
Adam and Christina
I think that connecting the templates to workflow can be grate tool.
It will solve many daily tasks.
The same way that I'm setting variables or sending mails during workflows transitions I would like to have the option to start template.
Whet do you think?
I'm not sure if you can actually "start a template" from the workflow.
But, all PDM is doing when it starts a template though is to copy a "template" file from a specified location into the new location and rename it. You can do all that through dispatch and set the dispatch action to happen when something goes through a specified workflow state.
Id did it but still there are some missing features that I've when using PDME templates.
E.g. I would like to copy a word file from one folder to another and this is easy to do with dispatch.
in addition I would like to generate serial number for the document name and to add variables to the office document from the cad document that passes the transition.
I'm not sure that I'm clear enough.
I know that I can reach my target when I'm using the PDME templates but I would like to trigger it by workflow.
I don't know of a way to trigger the PDME templates with a workflow... that doesn't mean there isn't a way, I'm still learning a lot of this too... but I don't know of one.
If you're needing to generate serial numbers as well as copy a file from one folder to another and name it from the serial number and pass variables from the cad document to the generated word document, then I think you're going to have to make an add-in. You can do all of that through an add-in and then use the "Execute Command" transition action on your workflow to kick off the add-in.
Your program would basically need to:
1. read information from the cad file that needs to get put into the word doc
2. grab a serial number
3. copy the template word doc from the templates folder into the new location and use the serial number as new name in the copy file command
4. write the variables that you gathered from the cad file to the word doc
5. check in the word doc
6. Possibly kick the word doc through the workflow a bit if you needed it to do that
You can do all that with an Add-in... just grab the add-in template for Visual studio that I mentioned earlier in this thread and look in the API help file for PDM for examples of all of these bits of code.
Thanks for the structure and Yes I've already looked at it.
The problem is that I have no expriance with API.
I didn't have any experience with API either until a couple of months ago when I had to start doing things with PDM that dispatch and the built-in workflow stuff couldn't handle doing.
That add-in template will get you going in the right direction really quickly and people in the forum are just wonderful at helping with things.
I think that structure should work for the order you'd need to do things in... generic of course... you'll have more stuff in between those steps... like logging into the vault first, etc... but most of that's covered in the API examples for each process.