Conversion Task Alternatives

Installation, PDM, standards, training, support, part numbering, rev schemes, etc.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Conversion Task Alternatives

Unread post by revenki »

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).
User avatar
AlexB
Posts: 434
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 22
x 242
x 383

Re: Conversion Task Alternatives

Unread post by AlexB »

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?
image.png
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.
User avatar
the_h4mmer
Posts: 136
Joined: Mon Jan 31, 2022 6:49 am
Answers: 1
x 106
x 80

Re: Conversion Task Alternatives

Unread post by the_h4mmer »

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.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
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.

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 ")
I would then substitute newPath in place of "[OutputPath]" in the ExportAsFixedFormat command (just above which is where the code was inserted).

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?
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

AlexB wrote: Thu May 12, 2022 8:42 am How are you putting together your file name? ...
Like so:

Code: Select all

<SourceFolderPath>\<FileName> - REV <%Revision%> - <%FileState%>
As I said the earlier reply, though, this part does exactly what it's supposed to do. All I need to do is replace the resulting "REV -" with "REV NEW".

(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.)
User avatar
the_h4mmer
Posts: 136
Joined: Mon Jan 31, 2022 6:49 am
Answers: 1
x 106
x 80

Re: Conversion Task Alternatives

Unread post by the_h4mmer »

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.
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.

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.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
User avatar
the_h4mmer
Posts: 136
Joined: Mon Jan 31, 2022 6:49 am
Answers: 1
x 106
x 80

Re: Conversion Task Alternatives

Unread post by the_h4mmer »

@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
it is formally "blessed off"
was an intentional pun, seeing that your company is in aerospace, if not, I hope it can/will be going forward. ;;
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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!
User avatar
AlexLachance
Posts: 1994
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2157
x 1847

Re: Conversion Task Alternatives

Unread post by AlexLachance »

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.
User avatar
AlexB
Posts: 434
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 22
x 242
x 383

Re: Conversion Task Alternatives

Unread post by AlexB »

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!
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.

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 ")
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
User avatar
AlexB
Posts: 434
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 22
x 242
x 383

Re: Conversion Task Alternatives

Unread post by AlexB »

revenki wrote: Thu Feb 23, 2023 1:53 pm 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.
An alternative may be BlueByte Systems - Convert Task Extended

He's posted a bunch of videos showing capabilities on their Linkedin page.
User avatar
AlexLachance
Posts: 1994
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2157
x 1847

Re: Conversion Task Alternatives

Unread post by AlexLachance »

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.
If you have questions, @CT-Simo is on the forums and could perhaps answer them if needed.
User avatar
CT-Simo
Posts: 19
Joined: Mon Oct 24, 2022 11:17 am
Answers: 0
x 7
x 18

Re: Conversion Task Alternatives

Unread post by CT-Simo »

@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/
User avatar
CT-Simo
Posts: 19
Joined: Mon Oct 24, 2022 11:17 am
Answers: 0
x 7
x 18

Re: Conversion Task Alternatives

Unread post by CT-Simo »

@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/
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

Re: Conversion Task Alternatives

Unread post by mp3-250 »

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!
@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.

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
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

Re: Conversion Task Alternatives

Unread post by mp3-250 »

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.
Solidworks "saveas" is bugged.
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.
User avatar
AlexLachance
Posts: 1994
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2157
x 1847

Re: Conversion Task Alternatives

Unread post by AlexLachance »

revenki wrote: Wed Apr 26, 2023 8:09 pm 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.
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.
User avatar
mp3-250
Posts: 540
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 601
x 282

Re: Conversion Task Alternatives

Unread post by mp3-250 »

@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.
User avatar
AlexLachance
Posts: 1994
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2157
x 1847

Re: Conversion Task Alternatives

Unread post by AlexLachance »

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.
Thanks for the reminder, I had in mind this was a topic about #TASK.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
User avatar
JSculley
Posts: 575
Joined: Tue May 04, 2021 7:28 am
Answers: 53
x 7
x 808

Re: Conversion Task Alternatives

Unread post by JSculley »

revenki wrote: Tue Aug 01, 2023 12:04 pm 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.
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.
revenki
Posts: 24
Joined: Fri Sep 24, 2021 11:17 pm
Answers: 0
x 7

Re: Conversion Task Alternatives

Unread post by revenki »

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.
Post Reply