Regarding the getdirbrowse() function within the command reference

Regarding the getdirbrowse() function within the command reference

kuwahara_ryo
Community Visitor Community Visitor
102 Views
1 Reply
Message 1 of 2

Regarding the getdirbrowse() function within the command reference

kuwahara_ryo
Community Visitor
Community Visitor

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
103 Views
1 Reply
Reply (1)
Message 2 of 2

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