Unicode Parasolid Support - Non-English

Posting this in API/Macro as it's a bit more of a "under-the-hood" technical question that I think fits better in this circle.

How do non-English Sldworks users here work with Parasolid (X_T) when Parasolid does not seem to support Unicode, non-ASCII characters?

Part of my job is processing Sldworks data from China / Taiwan via X_T Parasolid files, but it seems like only ASCII characters are supported with Parasolid files. All the unicode Mandarin symbols get replaced with underscores when I save an assembly out to X_T which means I'm losing important reference configuration or part name data.

Is there anyway to get Parasolid to respect Unicode characters or am I out of luck on this one? Tested with v27 and v31 of Parasolid between Sldworks 2015 & Sldworks 2019

Thank you,

Clayton

SolidworksApi/macros
Answers 21
JB
JB 2021-04-08 Best Answer

Shot in the dark here... Have you tried x_b?

CK
CK 2021-04-08

Update! Long story short, although Solidworks can open up native assemblies and parts named with non-English languages, it cannot save to X_T, retaining non-English characters, without the appropriate Solidworks language packs installed. Turns out, the administrative images IT installed on my computer only included English.

Now, I'm able to save out my test assembly as an X_T, open the X_T up in a text editor and see the Mandarin symbols fine. The X_T opens up in Solidworks, retaining the Mandarin characters.

This is all well and fine, but still, opening up an X_T saved out by our Engineer from China, still yields question marks representing unsupported characters (I've installed all language packs I can think of on Windows that may relate to Mandarin.. Chinese, simplified Chinese, etc...). At any rate, mystery solved I suppose! Thank you all for the valuable feedback and information. 

CK
CK 2021-04-08

Transcode problem is actually better than not having any differentiation in the name of various parts after all unicode characters are replaced with "_" when dealing with X_T. Thank you for pointing that out.

CK
CK 2021-04-08

Asking for an X_T from China is a great idea Josh! I'll put in a request for one now. You are right that STEP / IGES preserve structure/hierarchy, but to my knowledge, they do not retain part space information (when you open a part in an assembly and the part file shows the part in it's own coordinate system instead of being offset in the assembly).

I'll firstly request for an X_T from our Chinese counterparts to see what's what. Great ideas guys! Very happy that I posted this question up here. Thank you

FL
FL 2021-04-08

I edit the x_t and STEP with Chinese character.

x_t won't import so its doesn't support that at all.

STEP import but there is an "transcode" problem:

comment imagecomment image
FL
FL 2021-04-08

Export to STEP result in ____ instead of ????.

5F instead of 3F.

JB
JB 2021-04-08

Clayton Krause wrote:

Yep, that's the conclusion I came to as well. I was just curious if any guru here knew of a workaround or an alternative file type that would hold assembly hierarchy and part space data and collapse the entire assembly into a single file. An alternative would ideally not be proprietary to Solidworks, but if it is, I'd make it work.

 

Cheers all.

Step, Parasolid, and IGES all preserve assembly structure/heirarchy.  Unfortunately, none of them seem to support the unicode characters.

SolidWorks is definitely exporting the unicode as "???" in the text output. However, it imports the "???" as "___".  This is because SW creates files for each part when you import.  Windows filenames cannot contain "?".  Even though configs/features/etc. within SW may contain "?",  the exported file does not have a distinction between "component name" and "configuration" information.  The entire string just becomes the name of the imported part, therefore it cannot contain "?".

You might get better luck if you install either additional language packs in Windows, or possibly even a different language install of SolidWorks...  Can you ask some of your Chinese folks to go ahead and export to Parasolid from their OS and send you the X_T file?  You can check it to see if it's all ??? or not.

FL
FL 2021-04-08

I don't think there is a fix.

From an HEX editor, the ???? are ????.

Now why SW import them to ____ ?

I can change config name in SW to ????.  So its valid.

CK
CK 2021-04-08

Yep, that's the conclusion I came to as well. I was just curious if any guru here knew of a workaround or an alternative file type that would hold assembly hierarchy and part space data and collapse the entire assembly into a single file. An alternative would ideally not be proprietary to Solidworks, but if it is, I'd make it work.

Cheers all.

JS
JS 2021-04-08

SOLIDWORKS is definitely the problem here.  If you create a new assembly with a couple of parts whose file names are Unicode like this:

When you save it out as x_t and then re-import it, you get this:

comment imagecomment imagecomment imagecomment image
CK
CK 2021-04-08

Aduh, was thinking of our production Solidworks CAD, not the text assembly I made. Attached is the test assembly. Both Zipped "pack and go" and X_T file. One part with three configurations. The three configuration names contain non-ASCII characters. Thank you for taking a look at this for me.

FL
FL 2021-04-08

Does your editor handle unicode?

Your editor show ???? and SW show ____.

If SW export ????, it'll import ???? not ____.

Something is there but your editor and SW can't decode.

Also Chinese are encode in different ways: GB, BIG5, UTF etc.

Make a empty assembly with empty parts with different cfg names.

Attach both SW files and X_T.

CK
CK 2021-04-08

Frederick, thank you for the reply. I'm not able to hand out the data as it's considered sensitive. That being said, it wouldn't do you any good anyways.

Opening the X_T in a text editor shows that all non-ASCII characters have been overridden by question marks. Here's an image of that showing the highlighted part name in the X_T file - "myPart(cfg????)"

 Thank you all for the interest and recommendations.

comment imagecomment image
FL
FL 2021-04-08

STEP can contain parts in an assembly.

When import, it'll create an assembly with parts.  Also subassembly.

CK
CK 2021-04-08

Josh - Just so you know, I replied a while back to your original post, but my reply is being moderated as it contains a link (not being rude or ignoring you, just waiting for the mods).

As far as I'm aware, an IGES will not save out the hierarchy of an assembly in a way that part space can be accessed. Having access to part space is critical so (unless I'm mistaken, IGES & STEP aren't valid options in this instance). 

FL
FL 2021-04-08

Kanji is Japanese.

Also try STEP.

FL
FL 2021-04-08

Attach the parasolid file.

JB
JB 2021-04-08

Is IGES an option?  Supposedly that standard supports Kanji....

CK
CK 2021-04-08

Maybe I didn't explain well enough. I understand the general limitations of X_T files, but what I was asking is if there is some magical way to allow X_T files to support Unicode characters. I'm needing to carry over the actual name and reference configuration name from assembly to X_T. See example photos below -

ASCII only from native assembly:

ASCII only from import X_T file derived from native assembly (notice how the naming of the ref config is baked in):

NOW, here the trouble starts when non-ASCII characters are being used. Examples below:

From native assembly (Mandarin used in configuration names. Works great.):

From import X_T file derived from native assembly (ALL Mandarin, non-ASCII gets replaced with "_" when exporting the Parasolid from Solidworks. This then is the result of importing the X_T in Solidworks):

 

 

comment imagecomment imagecomment imagecomment imagecomment imagecomment imagecomment imagecomment image
FL
FL 2021-04-08

Your example show a direct translate of "Default" and "Display State" which is the same for every SW file.

It doesn't show any more information.

Also Parasolid will not give you config or display state.

The file need to be export for each config and display with different filename.

You don't even get custom properties, not even material.

You've lost everything already with the parasolid file.

I don't think you missed anything 

It didn't even save the config name in the model.

CK
CK 2021-04-08

Thank you for the reply Josh. I have tried x_b as well with the same results.

Trying to sift through the Parasolid documentation (http://www.13thmonkey.org/documentation/CAD/Parasolid-XT-format-reference.pdf ), I'm thinking that Parasolid only supports ascii (from what I can tell, which isn't much). Even if it did support unicode, I could only find a version option for parasolid export in the export options. I think I'm SOL on this one.

Would you have any other neutral 3D format recommendations that could be used as an alternative to parasolid that I could try out that may support unicode? Any alternatives would need to be able to save full hierarchy assembly information as well as part space and part component occurrence xform offset in the assembly.

Thanks again.