Showing edges in color according to the main axes
-
Insert a component far from the origin 0 0 0, and give it the right orientation, is difficult because the global axis are not visible in the window
you have to memorize where they are, or zoom out to see it, and then zoom in again to insert the component precisely
Sketchup gives the possibility to color the objects edges according to their direction, which is great because this way, you always know where the main axes are, even if you are far from the origin
Would it be possible to write a plugin that would toggle the edges color to the main axes, just by pressing a key on the keyboard?
-
Jim's custom toolbar plugin has such a button.
The one right to it will toggle endpoints - also a good thing when trouble shooting or connecting mesh. -
@gaieus said:
Jim's custom toolbar plugin has such a button.
[attachment=0:381h7ksq]<!-- ia0 -->CustomToolbar.png<!-- ia0 -->[/attachment:381h7ksq]
The one right to it will toggle endpoints - also a good thing when trouble shooting or connecting mesh.thank you
yes, i realized it later, and that i could do it myself...
As an alternative to buttons, i like to use keyboard shortcuts; so i slightly modified Jim's plugin to assign a key to it
Here is the code, without any garantee; it works with me, but i only copied and pasted, cannot explain what i did in detail ...
require 'sketchup.rb' # Add a menu item to launch our plugin. UI.menu("PlugIns").add_item("colored_edges") { colored_edges } # ----------------------------------------------------------------------------- def colored_edges mod = Sketchup.active_model # Open model ent = mod.entities # All entities in model sel = mod.selection # Current selection ro = Sketchup.active_model.rendering_options ecm = ro["EdgeColorMode"] if ecm != 2 ecm = 2 Sketchup.set_status_text "Egde Color Mode; by Axis" else ecm = 1 Sketchup.set_status_text "Egde Color Mode; Default" end ro["EdgeColorMode"] = ecm end def axisedge_validation_proc if Sketchup.active_model.rendering_options["EdgeColorMode"] == 2 return MF_CHECKED else return MF_UNCHECKED end end
Advertisement