Regarding the getdirbrowse() function within the command reference

Regarding the getdirbrowse() function within the command reference

kuwahara_ryo
Explorer Explorer
139 Views
2 Replies
Message 1 of 3

Regarding the getdirbrowse() function within the command reference

kuwahara_ryo
Explorer
Explorer

I have a question regarding the getdirbrowse() function found in the command reference.

 

I understand that the first argument of this function takes a string-type initialdir. I think the usage example also describes obtaining a path, such as documentsdir(), and passing it as an argument.

 

The issue I'm currently experiencing in my environment is that when I execute getdirbrowse() with documentdir() as the first argument, as shown in the image below, a Unicode exception occurs in the system console.

 

kuwahara_ryo_0-1756883634305.png

 

 

If the path obtained by documentsdir() contains multibyte characters like Japanese, does this error occur because a string containing multibyte characters is passed to the first argument of getdirbrowse()?

 

I also tried passing strings like “C:” or strings without multibyte characters as the first argument. However, regardless of the argument value, the path of the folder or file selected in the Explorer window popped up from FlexSim before executing getdirbrowse() appears as the initial search location. While the error doesn't occur if the first argument doesn't contain multibyte characters, the specified directory doesn't open, which feels unnatural.

 

Could you please explain the specification for the first argument of getdirbrowse(), a safe method to pass a full path containing multibyte characters to initialdir, and how to pop the Explorer window to display the specified directory?

0 Likes
140 Views
2 Replies
Replies (2)
Message 2 of 3

kavika_faleumu
Autodesk
Autodesk

Hey @kuwahara_ryo, after some testing, I don't think getdirbrowse can handle multibyte strings. I've notified the dev team to investigate further and fix.

Thank you for bringing this to our attention!

0 Likes
Message 3 of 3

kuwahara_ryo
Explorer
Explorer

Mr @kavika_faleumu,  thank you for sharing this issue with the development team.
At present, I have implemented a workaround for the first argument using the cdir() function to avoid multibyte characters. I would appreciate if you could inform us again once the multibyte error has been fixed.

0 Likes