Skip to content
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

Escape Object names properly #13

Open
mattedicksoncom opened this issue Oct 20, 2020 · 1 comment
Open

Escape Object names properly #13

mattedicksoncom opened this issue Oct 20, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mattedicksoncom
Copy link
Owner

Object names aren't being escaped properly.
Work on a robust solution that takes any name thrown at it.
Currently name_compat in ./export_obj_simple.py simply replaces spaces with under scores.

  • Cannot accept raw spaces
  • Fails on names like Test-Test 10x20x30mm [1234]

Quick dirty hack that works:

  • Replace line 38 return name.replace(' ', '_') in ./export_obj_simple.py
  • Replace with replaceName = name.replace(' ', '_s__') replaceName = replaceName.replace('.', '_d__') replaceName = replaceName.replace('[', '_b__') replaceName = replaceName.replace(']', '_c__') return replaceName
  • Then in ./__init__.py after obTest = importObject at line 88
  • place obTest.obName = obTest.obName.replace( '_s__', ' ') obTest.obName = obTest.obName.replace( '_d__', '.') obTest.obName = obTest.obName.replace( '_b__', '[') obTest.obName = obTest.obName.replace( '_c__', ']')
  • Refresh Scripts
@mattedicksoncom mattedicksoncom added the bug Something isn't working label Oct 20, 2020
@mattedicksoncom mattedicksoncom self-assigned this Oct 20, 2020
@mattedicksoncom
Copy link
Owner Author

Had an epiphany, I don't know why I used UUID's for this.
Some form of counter should work just as well, if not better.
eg. xat_0, xat_1, xat_2

I need to investigate if there was a good reason I used them and write it down though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant