Conversion Task Alternatives
Conversion Task Alternatives
Does anyone know of alternatives to the conversion tasks in PDM Pro (2021 in our case) that actually work?
I'm at wits end trying to get it to do a simple renaming of the output files to suit our company naming policy. It's something that the output file path template can't do (changing "REV -" in the output PDF filename to "REV NEW"), and which I previously accomplished with a couple lines of code in the task script when we used 2019. Have talked with our VAR several times about this, they were of no help. I've wasted days on this lately, and I'm done.
I just want the conversion tasks to WORK so that I don't have to keep cleaning up the mess or poking around uselessly under the hood - this stupid problem is keeping me from making more valuable improvements to PDM.
I recall that HawkRidge Systems had something in their Hawkware Tools packages, but I just checked their site and can't find the feature list I remember (only videos about the packages).
I'm at wits end trying to get it to do a simple renaming of the output files to suit our company naming policy. It's something that the output file path template can't do (changing "REV -" in the output PDF filename to "REV NEW"), and which I previously accomplished with a couple lines of code in the task script when we used 2019. Have talked with our VAR several times about this, they were of no help. I've wasted days on this lately, and I'm done.
I just want the conversion tasks to WORK so that I don't have to keep cleaning up the mess or poking around uselessly under the hood - this stupid problem is keeping me from making more valuable improvements to PDM.
I recall that HawkRidge Systems had something in their Hawkware Tools packages, but I just checked their site and can't find the feature list I remember (only videos about the packages).
Re: Conversion Task Alternatives
How are you putting together your file name? Are you saying the output path section of the conversion add-in is not working or lacks the functionality you need?
A bit more detail may help point me in the right direction but I would say that a Dispatch script that runs after PDF creation may be a solution if the conversion tasks don't work.- the_h4mmer
- Posts: 136
- Joined: Mon Jan 31, 2022 6:49 am
- x 106
- x 80
Re: Conversion Task Alternatives
To the point @AlexB brought up, the conversion add-in for PDM 2021 seems usable if I understand what's being sought. I configured the conversion add-in to use [Source file root path]\[Source file name]-REV-[Source file revision] with the '-REV-' text being what I manually typed in. When files were output, they would end up in the same folder as the source file, named as "PARTNUMBER-REV-A.PDF" for something that had been released with revision A.
Re: Conversion Task Alternatives
I can do this part, with our equivalent filename structure being "PARTNUMBER - REV A - RELEASED.pdf" (or IN WORK or UNDER REVIEW for the state name). Defining the filename using the output file path variables is fine, that works, does exactly what it is told to do.the_h4mmer wrote: ↑Fri May 13, 2022 7:05 am ... named as "PARTNUMBER-REV-A.PDF" for something that had been released with revision A.
The problem is with REV - ("rev dash"), which is the revision value for all initial releases (our revision letters go -, A, B, C, D, so on). Every part when it is first released is REV -. But, this gives us filenames using the output file path variables like "PARTNUMBER - REV - - RELEASED.pdf", which can be confusing.
Our common approach to these situations where "REV -" can cause confusion is to use "REV NEW" in its place. Prior to our upgrade from PDM Pro 2019 to 2021, I accomplished this via three lines of code (from memory):
Code: Select all
Dim newPath as String
newPath = "[OutputPath]"
newPath = Replace(newPath, "REV - ", "REV NEW ")
It works fine when I do this, as long as I don't insert newPath in place of "[OutputPath]". Then it errors out: "The program used an object without initializing it properly first. E_EDM_NOT_INITIALIZED (0x080040201)".
It's not that I'm using an undeclared variable, because I declare it (I missed that at one point, it gave me a different error).
Is it because there is some sequencing issue or time delay with PDM applying the "macros" (the value for "[OutputFile]" in this case), and I'm trying to modify the output file path before it's ready for it?
Re: Conversion Task Alternatives
Like so:
Code: Select all
<SourceFolderPath>\<FileName> - REV <%Revision%> - <%FileState%>
(If it helps anyone else, <%Revision%> is used in place of <FileRev> because the latter, which is what the variable selection panel will put into the output file path field, simply would not read in to the filename; the former as I understand it reads the letter directly from the SQL database.)
- the_h4mmer
- Posts: 136
- Joined: Mon Jan 31, 2022 6:49 am
- x 106
- x 80
Re: Conversion Task Alternatives
Ah, okay seeing the full structure of your naming and having a better sense of the revision scheme helps. So I can suggest a means of doing this without the API or code (not sure if that's preferable). If you create a new variable "design status" or something similar, that gets set/changed based on transitions, you'd be able to call this for the convert task.revenki wrote: ↑Fri May 13, 2022 5:17 pm I can do this part, with our equivalent filename structure being "PARTNUMBER - REV A - RELEASED.pdf" (or IN WORK or UNDER REVIEW for the state name). Defining the filename using the output file path variables is fine, that works, does exactly what it is told to do.
The problem is with REV - ("rev dash"), which is the revision value for all initial releases (our revision letters go -, A, B, C, D, so on). Every part when it is first released is REV -. But, this gives us filenames using the output file path variables like "PARTNUMBER - REV - - RELEASED.pdf", which can be confusing.
When the REV is set to (-) you set design status to (NEW or IN WORK)
When transitioned to review, set design status to (UNDER REVIEW)
When REV is set to (A) you set the design status to (RELEASED)
This way you could use the %design status% variable in your file naming for the convert task.
I will say that it might be ideal to change using (-) as a deliminator in the filename AND your placeholder for the revision variable, but I understand that there could be more involved in making that change. Also, I did make an assumption that when the REV is set to (-) that the design would never be considered 'released' but I do see that in your prior post you show this as being an issue to resolve; I'm confused by this but again assume that you have your reasons.
Re: Conversion Task Alternatives
We're a small aerospace company, so I gather we do things a little bit differently from other industries. Based on experience with several of the Big Aero companies, we use revisions as follows:
- a model/drawing is initiated with the revision value of dash, which is interchangeably called "rev dash" or "rev new";
- it is known as rev dash throughout the initial modeling and drafting work;
- at initial release, it is formally "blessed off" as rev dash;
- at the initiation of the next revision, it is returned to the in-work or draft state with the revision value incremented to A;
- it is known as rev A throughout the model and drawing revision work;
- upon release, it is formally blessed off as rev A.
So, the revision letter "looks forward", where some industries it will "look backward" (i.e. not be incremented until release). Which may seem strange (it did to our VAR), but "look forward" is normal to me after 25 years of experience. I didn't even know until about a year ago that some industries do it the other way.
I've considered what you suggest (using a supplementary variable), as I do that with the state. Technically, the filename is reading this placeholder instead of the live workflow state value, so that it can show as "DRAFT" instead of "IN WORK" where conventions require it. I just was mildly uncomfortable doing that with something as "DNA-level" to a file as the revision value. I may not have a choice, though.
- a model/drawing is initiated with the revision value of dash, which is interchangeably called "rev dash" or "rev new";
- it is known as rev dash throughout the initial modeling and drafting work;
- at initial release, it is formally "blessed off" as rev dash;
- at the initiation of the next revision, it is returned to the in-work or draft state with the revision value incremented to A;
- it is known as rev A throughout the model and drawing revision work;
- upon release, it is formally blessed off as rev A.
So, the revision letter "looks forward", where some industries it will "look backward" (i.e. not be incremented until release). Which may seem strange (it did to our VAR), but "look forward" is normal to me after 25 years of experience. I didn't even know until about a year ago that some industries do it the other way.
I've considered what you suggest (using a supplementary variable), as I do that with the state. Technically, the filename is reading this placeholder instead of the live workflow state value, so that it can show as "DRAFT" instead of "IN WORK" where conventions require it. I just was mildly uncomfortable doing that with something as "DNA-level" to a file as the revision value. I may not have a choice, though.
- the_h4mmer
- Posts: 136
- Joined: Mon Jan 31, 2022 6:49 am
- x 106
- x 80
Re: Conversion Task Alternatives
@revenki I get that messing with revision/naming conventions can be challenging, especially when it's been used for a long time, but sometimes change is good; even if only as a test. The forward revision makes sense (to me) for particular circumstances, I'm a bit confused by an 'official' released revision being 'dash' but hey, that's just me, clearly it's worked for your organization.
As a non sequitur, I really hope that
As a non sequitur, I really hope that
was an intentional pun, seeing that your company is in aerospace, if not, I hope it can/will be going forward.it is formally "blessed off"
Re: Conversion Task Alternatives
Resurrecting this thread...
I really, really want an alternative to the convert-drawing-to-pdf task. Whether it's third party, or someone has a print-drawing-to-pdf mod that they'd be willing to share.
I'm sick of the "task failed" emails coming to me on about a third of the conversion tasks.
Please help me preserve my sanity!
I really, really want an alternative to the convert-drawing-to-pdf task. Whether it's third party, or someone has a print-drawing-to-pdf mod that they'd be willing to share.
I'm sick of the "task failed" emails coming to me on about a third of the conversion tasks.
Please help me preserve my sanity!
- AlexLachance
- Posts: 2184
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2364
- x 2013
Re: Conversion Task Alternatives
Hey Revenki,
I use CustomTools. Our profile is built so that when we save drawings, PDF's are created. There's a bunch of other details to it but I'm pretty sure you can achieve what you're looking for with it. When we save part drawings, it also creates our DXF.
You can create batch tasks to run on projects to create PDF and DXF of the project's files.
I use CustomTools. Our profile is built so that when we save drawings, PDF's are created. There's a bunch of other details to it but I'm pretty sure you can achieve what you're looking for with it. When we save part drawings, it also creates our DXF.
You can create batch tasks to run on projects to create PDF and DXF of the project's files.
Re: Conversion Task Alternatives
Looking into this further, there is a function called GetFullFileName in the default script that may be a better place to put your replacement line.revenki wrote: ↑Wed Feb 22, 2023 8:07 pm Resurrecting this thread...
I really, really want an alternative to the convert-drawing-to-pdf task. Whether it's third party, or someone has a print-drawing-to-pdf mod that they'd be willing to share.
I'm sick of the "task failed" emails coming to me on about a third of the conversion tasks.
Please help me preserve my sanity!
If you add the following line in there next to all of the other Replace lines, it will hopefully work better
Code: Select all
finalFileName = Replace(finalFileName, "REV - ", "REV NEW ")
Re: Conversion Task Alternatives
AlexL: thanks for the pointer to CustomTools (https://www.customtools.info). I'm checking them out now.
AlexB: I'll give that a try in the meantime, and see if that helps with the prior problem. That actually has been stable for a while.
AlexB: I'll give that a try in the meantime, and see if that helps with the prior problem. That actually has been stable for a while.
Re: Conversion Task Alternatives
An alternative may be BlueByte Systems - Convert Task Extended
He's posted a bunch of videos showing capabilities on their Linkedin page.
- AlexLachance
- Posts: 2184
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2364
- x 2013
Re: Conversion Task Alternatives
If you have questions, @CT-Simo is on the forums and could perhaps answer them if needed.revenki wrote: ↑Thu Feb 23, 2023 1:53 pm AlexL: thanks for the pointer to CustomTools (https://www.customtools.info). I'm checking them out now.
AlexB: I'll give that a try in the meantime, and see if that helps with the prior problem. That actually has been stable for a while.
Re: Conversion Task Alternatives
@revenki, I have a webinar related to this today. I can post the recording of it afterwards
Product Manager, CUSTOMTOOLS for SOLIDWORKS
Over decade of experience around SW, PDM, and related ERP integrations.
Tech-oriented; once a programmer, always a programmer.
https://www.customtools.info/
https://www.youtube.com/user/CustomTools4SW/
Over decade of experience around SW, PDM, and related ERP integrations.
Tech-oriented; once a programmer, always a programmer.
https://www.customtools.info/
https://www.youtube.com/user/CustomTools4SW/
Re: Conversion Task Alternatives
@revenki, check this thread for the recording of the webinar: viewtopic.php?p=27187#p27187
Product Manager, CUSTOMTOOLS for SOLIDWORKS
Over decade of experience around SW, PDM, and related ERP integrations.
Tech-oriented; once a programmer, always a programmer.
https://www.customtools.info/
https://www.youtube.com/user/CustomTools4SW/
Over decade of experience around SW, PDM, and related ERP integrations.
Tech-oriented; once a programmer, always a programmer.
https://www.customtools.info/
https://www.youtube.com/user/CustomTools4SW/
Re: Conversion Task Alternatives
@revenki I set up a custom task with PDF24 printer. It is the only completely free and working solution to output decent PDFs from SOLIDWORKS.revenki wrote: ↑Wed Feb 22, 2023 8:07 pm Resurrecting this thread...
I really, really want an alternative to the convert-drawing-to-pdf task. Whether it's third party, or someone has a print-drawing-to-pdf mod that they'd be willing to share.
I'm sick of the "task failed" emails coming to me on about a third of the conversion tasks.
Please help me preserve my sanity!
PDF task convert is based on save as dialog which is buggy. I cannot share the full solution, but you have to modify the whole script if you use ISO format. for the US one probably it works out of the box.
※ PDF conversion fails on a font not found as a dialog pops up and it is not allowed when launching SW automatically.
Other bugs include detail labels not exported and customized dimension arrows that disappear randomly
Re: Conversion Task Alternatives
I think I found a dead-simple alternative that works.
I'm teaching myself VB.NET. Discovered that there is a simple command in SW API, modeldoc2.extension.SaveAs3, which will save files to PDF.
Built a small executable around it, which I'm currently troubleshooting. Basically, it takes passed command-line arguments (full path, rev, and state from a drawing file), generates the destination path and filename to fit company standards, opens the drawing file in SW, saves to PDF, sets the data card values on the PDF to match those on the drawing, and then checks in the PDF.
Along the way, it checks if the destination file exists and if the PDF it's about to create also exists, and bails out with a popup message if that's the case (I'll handle those better later on).
So, once debugged, I can create a dispatch for users to run it manually on any drawing file, and I can attach it as an action to the promotion transitions in our main workflow (so that it gets triggered when promoted for review and again for release).
All told it took me about three hours of coding, which is less than we spend in a week as a company troubleshooting the botched output from the drawing-to-pdf task (and probably twice as long as it should have taken, given I'm still learning VB.NET).
I'm not going to post the code here, as the core of it is just the SaveAs3 command -- the rest is highly company specific. It's worth noting that there are a few other, obsolete SaveAs commands (under ModelDoc2, IIRC) that are easier to set up than the one I cited above. There just isn't documentation of the options, so you can't really take advantage of them beyond the basic functionality you can infer from the intellisense prompts.
I'm teaching myself VB.NET. Discovered that there is a simple command in SW API, modeldoc2.extension.SaveAs3, which will save files to PDF.
Built a small executable around it, which I'm currently troubleshooting. Basically, it takes passed command-line arguments (full path, rev, and state from a drawing file), generates the destination path and filename to fit company standards, opens the drawing file in SW, saves to PDF, sets the data card values on the PDF to match those on the drawing, and then checks in the PDF.
Along the way, it checks if the destination file exists and if the PDF it's about to create also exists, and bails out with a popup message if that's the case (I'll handle those better later on).
So, once debugged, I can create a dispatch for users to run it manually on any drawing file, and I can attach it as an action to the promotion transitions in our main workflow (so that it gets triggered when promoted for review and again for release).
All told it took me about three hours of coding, which is less than we spend in a week as a company troubleshooting the botched output from the drawing-to-pdf task (and probably twice as long as it should have taken, given I'm still learning VB.NET).
I'm not going to post the code here, as the core of it is just the SaveAs3 command -- the rest is highly company specific. It's worth noting that there are a few other, obsolete SaveAs commands (under ModelDoc2, IIRC) that are easier to set up than the one I cited above. There just isn't documentation of the options, so you can't really take advantage of them beyond the basic functionality you can infer from the intellisense prompts.
Re: Conversion Task Alternatives
BTW, the task is growing more unreliable and chaotic by the day, it seems. All the releases in the past week have had almost surreal superimpositions of geometry from views or even components not present on a sheet.
Wacky.
Wacky.
Re: Conversion Task Alternatives
Solidworks "saveas" is bugged.revenki wrote: ↑Wed Apr 26, 2023 8:06 pm I think I found a dead-simple alternative that works.
I'm teaching myself VB.NET. Discovered that there is a simple command in SW API, modeldoc2.extension.SaveAs3, which will save files to PDF.
Built a small executable around it, which I'm currently troubleshooting. Basically, it takes passed command-line arguments (full path, rev, and state from a drawing file), generates the destination path and filename to fit company standards, opens the drawing file in SW, saves to PDF, sets the data card values on the PDF to match those on the drawing, and then checks in the PDF.
Along the way, it checks if the destination file exists and if the PDF it's about to create also exists, and bails out with a popup message if that's the case (I'll handle those better later on).
So, once debugged, I can create a dispatch for users to run it manually on any drawing file, and I can attach it as an action to the promotion transitions in our main workflow (so that it gets triggered when promoted for review and again for release).
All told it took me about three hours of coding, which is less than we spend in a week as a company troubleshooting the botched output from the drawing-to-pdf task (and probably twice as long as it should have taken, given I'm still learning VB.NET).
I'm not going to post the code here, as the core of it is just the SaveAs3 command -- the rest is highly company specific. It's worth noting that there are a few other, obsolete SaveAs commands (under ModelDoc2, IIRC) that are easier to set up than the one I cited above. There just isn't documentation of the options, so you can't really take advantage of them beyond the basic functionality you can infer from the intellisense prompts.
We have at least 3 scenario that generate a useless or wrong output using saveas or convert task which is based on it.
the only reliable alternative way I found to automate safely is to print to PDF (at least WYSIWYG) but there are some small inconvenience.
- AlexLachance
- Posts: 2184
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2364
- x 2013
Re: Conversion Task Alternatives
A guy I know created a program and is currently reaching out to SolidWorks for a Gold certification. In his program, there is batch processing like #TASK used to do, maybe not as clear, but it's still being developed.
I asked him to have the program be available in english so that it could be used pretty much everywhere as an alternative to TASK.
Re: Conversion Task Alternatives
@AlexLachance just to be sure we are talkIng about the same thing. I think this thread was about "PDM task", not the normal one outside the pdm vault. the tool must be deployed automatically to each pdm client and user rights, logs, and task list must be manageable from the pdm administration.
- AlexLachance
- Posts: 2184
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2364
- x 2013
Re: Conversion Task Alternatives
Thanks for the reminder, I had in mind this was a topic about #TASK.mp3-250 wrote: ↑Thu Apr 27, 2023 6:54 pm @AlexLachance just to be sure we are talkIng about the same thing. I think this thread was about "PDM task", not the normal one outside the pdm vault. the tool must be deployed automatically to each pdm client and user rights, logs, and task list must be manageable from the pdm administration.
Re: Conversion Task Alternatives
A few months later, I've finally gotten my simple script to run as intended.
Three hours of initial coding got me about 90% there, the last 10% has taken three months and 40+ hours.
I'm starting to passionately hate PDM.
Three hours of initial coding got me about 90% there, the last 10% has taken three months and 40+ hours.
I'm starting to passionately hate PDM.
Re: Conversion Task Alternatives
Learn how to write regular PDM add-ins using the PDM API with C# (VB.NET if you must, but C# is superior). Tasks and Dispatch scripts are just dumbed down layers on top of the API that limit what you can do.
Re: Conversion Task Alternatives
I've been doing just that, migrating myself over to VB.net (just because of the learning curve involved - I have a *lot* of practice with VBA).
This print tool was the first thing I've done that way. Unfortunately, I haven't had time to do more because WatchGuard has torpedoed our entire network. Dealing with the fallout from that uses up all the time I'd otherwise have for porting over the rest of my SW/PDM tools.
This print tool was the first thing I've done that way. Unfortunately, I haven't had time to do more because WatchGuard has torpedoed our entire network. Dealing with the fallout from that uses up all the time I'd otherwise have for porting over the rest of my SW/PDM tools.