One of the limitations of SU is that it can be difficult to keep guide lines that might be useful. That is because the Delete Guides command is all encompassing and will delete guide lines even when “protected” inside a Group or Component. A workaround I have found is to Select All, then Select Guides (might require Selection Toys extension) before deleting. That will only select the guides in the current level, leaving those in any nested levels untouched.
I would like to replace the shortcut key I use for the inbuilt Delete Guides command with one that runs the above sequence. There is advice about how to use Automator here but I am not sure whether it can be made to work for what I want to do. The tutorial is 7 years old and I am not sure it still applies. Does anyone know?
Copy/paste this text into a new text-file using a plain-text editor like TextWrangler [MAC] - or Notepad++ [PC].
Name the file DeleteActiveGuides.rb
Make or put it in the …/Plugins folder.
After SketchUp restarts and loads it, it creates a new entry in the Extensions menu, named DeleteActiveGuides
It deletes the guides in the current context, leaving any nested inside groups etc unaffected.
It’s one-step undo-able.
You can easily make a shortcut to this…
# encoding: UTF-8
module TIG
module DeleteActiveGuides
unless @loaded
UI.menu("Plugins").add_item("DeleteActiveGuides"){self.run()}
@loaded = true
end
def self.run()
model = Sketchup.active_model
model.start_operation("DeleteActiveGuides", true)
ents = model.active_entities
glns = ents.grep(Sketchup::ConstructionLine)
ents.erase_entities(glns) if glns[0]
model.commit_operation
end
end
end
Did exactly as you said and bingo, it works like a dream. Put a smile on my face today. Thanks @TIG. A much more elegant solution than using Automator, I’m sure.
You’re quite right. I assumed it would work much like the native Delete Guides by deleting points too. But I will try out your new version. The old version works fine and is useful whatever.
Just tested the new version and with @DanRathbun’s suggested tweak. It all works as expected. So thanks guys, that’s going to give me a new string to my bow.
Now if we could just make the guide lines within a group only visible when you are editing it… I know, I know, now I’m really pushing my luck!
Sounds like a good general FR for the application.
Please note that Guides (points and lines) as well as dimensions and callout text are NOT geometric primitives, so they can use special layers so you can control their visibility.
If you do this, then an extension could likely be written to automatically show and hide the group’s guides by using an InstanceObserver. Actually might not even need guide layers. (I just prefer them to using the specific entity hidden property.)
I’d be surprised if there wasn’t already an extension to do this.
Another thing to consider. IF a group or component instance’s guide are unhidden, then they’ll be unhidden in all instance’s of that group or component.