Customizing TASK convert path

Discuss SolidWorks PDM
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 704
x 347

Customizing TASK convert path

Unread post by mp3-250 »

Convertion TASKS like pdf, dxf, step allow a certain extent of customization of the default path.
I am lookIng for a way to set the default output to the current user desktop

I have tried %userprofile%, but it does not work.
I want to leave the users The possibility to change it anyway.
by mp3-250 » Wed Apr 05, 2023 9:36 pm
I digged in the (new?)KB and I found some useful articles.
I am going to update this post as I find them fit my needs
QA00000117004
Is it possible to use a currently logged user name in the output folder name when using the SOLIDWORKS® PDM convert task?

The attached instructions show how to update the default convert task advanced script with SOLIDWORKS® PDM API code to extract the currently logged user name and use it as a folder name for the output file.

See also:
S-054527 – ‘How to modify convert task to use variable value from source file in output file name’
S-061104 – ‘How to modify convert task to use variable value from source file in folder name of output path’
https://kb.dsxclient.3ds.com/mashup-ui/ ... 20variable


QUESTION
How do I remove illegal characters from the output file name of a SOLIDWORKS® PDM Convert Task, if a file name or path contains a datacard variable value?
ANSWER
The SOLIDWORKS® PDM Convert Task allows you to use datacard variables in the file name or file path. If any of the variables contain illegal characters, that is characters that Windows® would normally strip \ / : * ? “ < >, then the task fails with the error “Error code 1 returned.”

The Convert Task script contains a section that handles those specific characters. However, the script does not consider if the file name and file path contain datacard variable values. In addition, the script does not handle / and \.

The attached PDF file describes how to include the variables and handle the /. The \ (backslash), is a bit more complicated because the path uses the backslash to separate folders and file name.
https://kb.dsxclient.3ds.com/mashup-ui/ ... 20variable
Go to full post
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 704
x 347

Re: Customizing TASK convert path

Unread post by mp3-250 »

I digged in the (new?)KB and I found some useful articles.
I am going to update this post as I find them fit my needs
QA00000117004
Is it possible to use a currently logged user name in the output folder name when using the SOLIDWORKS® PDM convert task?

The attached instructions show how to update the default convert task advanced script with SOLIDWORKS® PDM API code to extract the currently logged user name and use it as a folder name for the output file.

See also:
S-054527 – ‘How to modify convert task to use variable value from source file in output file name’
S-061104 – ‘How to modify convert task to use variable value from source file in folder name of output path’
https://kb.dsxclient.3ds.com/mashup-ui/ ... 20variable


QUESTION
How do I remove illegal characters from the output file name of a SOLIDWORKS® PDM Convert Task, if a file name or path contains a datacard variable value?
ANSWER
The SOLIDWORKS® PDM Convert Task allows you to use datacard variables in the file name or file path. If any of the variables contain illegal characters, that is characters that Windows® would normally strip \ / : * ? “ < >, then the task fails with the error “Error code 1 returned.”

The Convert Task script contains a section that handles those specific characters. However, the script does not consider if the file name and file path contain datacard variable values. In addition, the script does not handle / and \.

The attached PDF file describes how to include the variables and handle the /. The \ (backslash), is a bit more complicated because the path uses the backslash to separate folders and file name.
https://kb.dsxclient.3ds.com/mashup-ui/ ... 20variable
Post Reply