How to batch change the state of Assemblies/parts in SW19 PDM
-
- Posts: 51
- Joined: Wed Mar 01, 2023 6:55 pm
- x 36
- x 5
How to batch change the state of Assemblies/parts in SW19 PDM
We have hundreds of parts and assemblies in a certain workflow state. I am the PDM administrator and I want to change the workflow state of all those parts with a VBA macro. I did some google searches but couldn't find any sample code. Si there anybody with some ideas how to do this? Most of the parts are in workflow state PD2. I need to skip PD3 and PD4 and move them on, without any approvals to PD5. Any Ideas
- jcapriotti
- Posts: 1897
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1236
- x 2029
Re: How to batch change the state of Assemblies/parts in SW19 PDM
You don't need a macro (there is no VBA option for PDM). You need a transition from the current state (P2) to the other state (P5). Then you just create a search that finds the parts you want to transition, right click them all and change state on them using that new transition.
That said, without knowing your workflow process and your PDM skillset, this is something you have to be careful with depending on transition actions that occur in the in between states. Things like Incrementing revisions and variable updates. You may need to duplicate some of them.
That said, without knowing your workflow process and your PDM skillset, this is something you have to be careful with depending on transition actions that occur in the in between states. Things like Incrementing revisions and variable updates. You may need to duplicate some of them.
Jason
-
- Posts: 51
- Joined: Wed Mar 01, 2023 6:55 pm
- x 36
- x 5
Re: How to batch change the state of Assemblies/parts in SW19 PDM
Thanks @jcapriotti , lazy me . I was hoping for a bit of code to transition a list of part through 5 states with the click of a button. No worries, I will do it the hard way then.
- jcapriotti
- Posts: 1897
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1236
- x 2029
Re: How to batch change the state of Assemblies/parts in SW19 PDM
Well, you could modify all of the transitions to temporarily make them "Automatic". I've never tried that many but it should go through them all to end up in the final state.
Jason
Re: How to batch change the state of Assemblies/parts in SW19 PDM
@jcapriotti just wanted to say that VBA can be used with PDM, I have made a custom task in VBA that replace the bugged version up tool of PDM: I can login into our vault, get latest, checkin, checkout and the only issue is (for a non IT person like me) the lack of documentation (to use an euphemism) and almost no examples around the web.
Re: How to batch change the state of Assemblies/parts in SW19 PDM
There is no VBA option for PDM standard. Maybe that is what he meant.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- jcapriotti
- Posts: 1897
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1236
- x 2029
Re: How to batch change the state of Assemblies/parts in SW19 PDM
His comment was VBA Macro which to me means old Visual Basic for applications code running in something like Word or Excel. I'm not aware if you can access PDM using that method. You can write vb.net or c# apps compiled as an exe and access your vault or call the EXE from a transition using the Transition Action "Execute Command". We do this with a number of programs.mp3-250 wrote: ↑Mon Dec 09, 2024 5:17 pm @jcapriotti just wanted to say that VBA can be used with PDM, I have made a custom task in VBA that replace the bugged version up tool of PDM: I can login into our vault, get latest, checkin, checkout and the only issue is (for a non IT person like me) the lack of documentation (to use an euphemism) and almost no examples around the web.
I was under the impression that Jacomuller simply need to bypass some of the workflow states as a administrator. This is simple to do as a bypass transition that only the administrator has access to see.
Jason
-
- Posts: 51
- Joined: Wed Mar 01, 2023 6:55 pm
- x 36
- x 5
Re: How to batch change the state of Assemblies/parts in SW19 PDM
@jcapriotti @SPerman , I have done a number of VBA macro's for Solidworks. For example, I have a macro that will with a click of the button, create a PDF file as well as a DXF file of a drawing. It will then save those files in the PDM, delete copies of old versions on the those files on the factory server, outside of the PDM and replace it with the new versions of those files. I also have a macro that will create shop floor papers for production with all sheet metal parts in an assembly. So, I have done a bit of work in Solidworks with VBA, normally I use VBA in ACCESS and EXCEL, but I am no expert in the Solidworks/PDM API
Re: How to batch change the state of Assemblies/parts in SW19 PDM
To be clear, there is no API support for PDM standard. That has nothing to do with API for solidworks.
Solidworks PDM Professional has a full API library available.
SOLIDWORKS PDM Professional API Help
And to clarify an earlier statement; I use the terms VBA and VB6 interchangeably. AFAIK, they are the same language, although it is likely there are minor differences between the two, especially considering VBA is still supported and VB6 has been dead for 15 years. The built in solidworks API editor is VB6. I have no idea about PDM API, as I only have a standard license.
Solidworks PDM Professional has a full API library available.
SOLIDWORKS PDM Professional API Help
And to clarify an earlier statement; I use the terms VBA and VB6 interchangeably. AFAIK, they are the same language, although it is likely there are minor differences between the two, especially considering VBA is still supported and VB6 has been dead for 15 years. The built in solidworks API editor is VB6. I have no idea about PDM API, as I only have a standard license.
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
- jcapriotti
- Posts: 1897
- Joined: Wed Mar 10, 2021 6:39 pm
- Location: The south
- x 1236
- x 2029
Re: How to batch change the state of Assemblies/parts in SW19 PDM
That's what I was suspecting. You're talking about the built-in VBA inside of SolidWorks or like you find in Word/Excel. Those are based on the old VB6 language. There is vb.net for which you need a copy of Visual studio to build code and compile standalone EXE/DLL programs files. PDM doesn't have a VBA environment like those apps. I didn't think it was possible but you might be able to use the VBA in SolidWorks to perform PDM commands, at least this video indicates you can although not sure what the limits are.Jacomuller wrote: ↑Tue Dec 10, 2024 3:28 pm @jcapriotti @SPerman , I have done a number of VBA macro's for Solidworks. For example, I have a macro that will with a click of the button, create a PDF file as well as a DXF file of a drawing. It will then save those files in the PDM, delete copies of old versions on the those files on the factory server, outside of the PDM and replace it with the new versions of those files. I also have a macro that will create shop floor papers for production with all sheet metal parts in an assembly. So, I have done a bit of work in Solidworks with VBA, normally I use VBA in ACCESS and EXCEL, but I am no expert in the Solidworks/PDM API
If this is a function you need to perform frequently from within SolidWorks, it may be worth it. A PDM Add-in would likely be better and more stable. If this is a one off activity, the workflow bypass is a better solution. At least with the add-in or bypass, you don't have to open SolidWorks or the model, you don't even need SolidWorks installed so non-cad users could do it.
Jason
-
- Posts: 51
- Joined: Wed Mar 01, 2023 6:55 pm
- x 36
- x 5
Re: How to batch change the state of Assemblies/parts in SW19 PDM
Thanks for the feedback - I have been programming in VB6 for many years - I am very old school.
I will put this one in the "too hard basket" for now. I am a Mechanical engineer doing some programming for fun. Thanks again for your time.
I will put this one in the "too hard basket" for now. I am a Mechanical engineer doing some programming for fun. Thanks again for your time.