-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Ruby console reports an error when the Material Export button is clicked #660
Comments
Hmm, I'm not sur to know why the "" before the M is a problem when the same "" before the S is not 🤔 |
Hi @wu1234a I am trying to reproduce the error that you encounter so we can work out a solution. I have tried to OpenCutList 6.2, 6.3-dev and 7.0-dev on my Windows 11 system with Sketchup 23 and 24, I also spun up a VM with Windows 10 and tested as my main system. So far, no error, can you provide more details of your system? Looking at the error, it seems to me that for some reason in your system, last_dir is receiving a string as path with a single backslash, that makes ruby escapes the string and error. Ruby should work fine with forward slash in all systems. I supposed that a helper method that sanitizes the path would do the trick in this case. Create a method in plugin.rb:
Use it in the export worker when getting the last_dir:
Also after selecting the path via save panel saves a sanitized version of the path for future use:
@bbeaulant please could you confirm if that is the right approach? |
Please note that the |
@bbeaulant, thanks for the context here. I take that you think the error occurs when BTW in all tests so far, PrivatePreferences has already received a forward slash path, as it should. The PrivatePreferences is stored in:
(respecting the Sketchup version) @ wu1234a, please could you provide your PrivatePreferences.json here so we can verify how that path was created. |
@mauriciobellon , thank you for your investigations. I prefer catching the error when reading instead of altering path value.
The strange thing here is that if the |
Hadn't seen that you are already treating for errors in
Didn't know that, you are right it should never happen. I will make some more tests to try to reproduce the error and see if we can identify where it goes wrong. |
I did it one hour ago after reading your message :) |
And that could explain why I didn't see it. :))) Should've looked at your commit reference. |
Sorry, I'm new to Ruby and not sure how to make changes, so I can only ask questions.
The text was updated successfully, but these errors were encountered: