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.
Change html on browser to modify toolbar
Alkis_Karaolis
Member Posts: 10 PRO
in General
Hi Onshape. I am new to the software and prefer all the commands to be visible in the toolbar, as opposed to some having a drop down list. I have a 4k screen so length of the bar is not an issue.
Since the toolbar is actually html, i made a chrome extension to change it (the html code) on the browser before rendering. To begin with, i tried to swap the word "Sketch" in the toolbar with the word "Drawing".
The extension worked with every website other than Onshape. So every website that has the word Sketch renders into Drawing. If i manually edit the rendered html i can manipulate the toolbar and even assign icons on custom features.
My example script is bellow
I understand that this is post you might not want to answer but it would really make my modelling faster to have a customised toolbar.
So my question is, what do you do from your side that overrides chrome extensions? Can i change the html code somehow?
Since the toolbar is actually html, i made a chrome extension to change it (the html code) on the browser before rendering. To begin with, i tried to swap the word "Sketch" in the toolbar with the word "Drawing".
The extension worked with every website other than Onshape. So every website that has the word Sketch renders into Drawing. If i manually edit the rendered html i can manipulate the toolbar and even assign icons on custom features.
My example script is bellow
var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; for (var j = 0; j < element.childNodes.length; j++) { var node = element.childNodes[j]; if (node.nodeType === 3) { var text = node.nodeValue; var replacedText = text.replace(/[word or phrase to replace here]/gi, '[new word or phrase]'); if (replacedText !== text) { element.replaceChild(document.createTextNode(replacedText), node); } } } <span>}</span>
I understand that this is post you might not want to answer but it would really make my modelling faster to have a customised toolbar.
So my question is, what do you do from your side that overrides chrome extensions? Can i change the html code somehow?
Tagged:
0
Comments
You can already customize your toolbar without trying to hack our code - right-click the toolbar and select "customize toolbar". Then drag an icon group into the dialog box which will then let you drag individual items to anywhere on the toolbar. Unfortunately, this does not work in drawings.
You can also assign icons to custom features without hacking too (although it must be coded into the feature by the author).
The reason you can't change the word "sketch" is because it is part of a localization string - it gets rendered on the fly depending upon which language you select.
This is good, but i want all commands as separate icons. For example Thicken has an icon but Enclose is only available in the drop down menu from the arrow next to Thicken.
Can i have Enclose as a separate icon without having to go into the drop down?
Kind regards
Alkis
HWM-Water Ltd
HWM-Water Ltd