Thanks kaas. It works like a charm.
Latest posts made by Gonvaz
-
Add icon to plugin
I'm trying to add an icon to a plugin but I can't make it work and I see no errors on the Ruby Console. Can you help?
Thanks in advance!require 'Sketchup'
filename=File.basename(FILE)
if not file_loaded?(filename)
UI.menu('Plugins').add_item('Container creator') { JGV_FVC3.container_creator() }
end#Toolbar test
if !file_loaded?("Container.rb")
#Container creator toolbar
FV_project_tb = UI::Toolbar.new("FV JGV")
#Container creator command
cmd3 = UI::Command.new(("Container creator")) { JGV_FVC3.container_creator() }
cmd3.small_icon = "containersmall.png"
cmd3.large_icon = "containerbig.png"
cmd3.tooltip = "Inserts a container"
FV_project_tb.add_item(cmd3)
end
#End Toolbar testfile_loaded(filename)
module JGV_FVC3
def self.container_creator
...
-
RE: Add all components with same name to new group
I was blind, now I can see.
Thank you, TIG.
-
RE: Add all components with same name to new group
Thanks, TIG but...
name=/^20x/ comps = mod.definitions.find_all{|d| d.name=~name}
74 ins = mod.active_entities.find_all{|e| comps.include?(e.definition)}
new_group = mod.active_entities.add_group(ins)
new_group.name = "Layout"Returns:
Error: #<NoMethodError: undefined method
definition' for #<Sketchup::Edge:0x0000000f893280>> C:/Users/jgv/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/Fill Surface.rb:74:in
block in fill_surface'
C:/Users/jgv/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/Fill Surface.rb:74:ineach' C:/Users/jgv/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/Fill Surface.rb:74:in
find_all'
C:/Users/jgv/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/Fill Surface.rb:74:infill_surface' C:/Users/jgv/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/Fill Surface.rb:12:in
block in <top (required)>'
SketchUp:1:in `call' -
Add all components with same name to new group
I've created some components that have the same name and I'd like to group them.
I tried this:
**mod = Sketchup.active_model
@ent = mod.active_entities
...comps = Sketchup.active_model.definitions[@C_name]
new_group = @ent.add_group comps
new_group.name = "Layout**"But I'm doing something wrong (the group isn't created). Could you help me?
-
RE: [Plugin] ShadowProjector
I'm really sorry, TIG! I attached a wrong SKP.
Now I have attached the one I was using to test the plugin.
And I have found why I couldn't make it work: some of the faces were reversed.
I just selected the faces, right-click the selection and click "Reverse Faces".
It works perfectly!
Thanks!
-
RE: [Plugin] ShadowProjector
I've been trying to make it work with the attached example.
Sometimes I get "You must preselect at least ONE suitably oriented face!".
When I get no message, I see no projections.
-
RE: [Plugin] ShadowProjector
I'm afraid I can't make it work. I select a face, then I click tools>ShadowProjector, select lines, or faces, etc. and nothing happens. I haven't been able to get any projection of any shadow.