Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
pretty-print a map?
adamohern
Member, OS Professional Posts: 216 PRO
The above is really hard on the eyes. I find it difficult to read. Is there a way to print out nested maps and arrays with better formatting?
0
Comments
So something like:
I'm not sure about your exact use case, but for sake of conciseness in the type, it might be nicer to group endPoint, axialRotation, and orientation into a single CoordSystem to start with (personally, I find it mind-numbing trying to do vector math unless I'm starting with a CoordSystem and can call fromWorld() everywhere).
In the future, we'd like to have a nicer way of presenting big chunks of native data by default (even when custom types aren't defined), but today, untyped data is printed as a big long literal.
Making a type is still good practice, but for the pretty-printing, calling the preexisting toString() will be much better than what you're seeing above.