[Plugin] Door-Lintel Update + Window-Sill
-
@tig said:
Sorry, but although I had updated the RBZ I forgot to click 'Publish' in the PluginStore Dev-page...
NOW its Download link should work !
EXCELLENT! THX
-
This plugin is wonderful!
Does it work within a component? It seems to work for me only when it's in the "open!?" -
I have been trying to use it using Profile Builder 3 , it seems to have some kind of problem detecting rectangular vertical face.
-
Hi syahirXIII,
The message shown on your image pops up when the reveal's face loop is made of more than 4 edges.
Please check if this is the case on the face that doesn't work.
Regards -
@TIG
hello
This plugin doesn't seem to support sketchup2024
A very suitable plugin, can you fix it working on sketchup024?
thanks -
@Didier-Bur
hello
This plugin doesn't seem to support sketchup2024
A very suitable plugin, can you fix it working on sketchup024?
thanks -
Hello! Can you update the plugin for the new skecthup 2024 please
-
Hi All,
Is this plugin working in 2024 sketchup? Huge time saver but not working for me in newest version.
-
@ SU2024 and Door-Lintel users:
Hi,
I don't have SU2024 installed on my PC.
Maybe some developer (TIG ?) will update the plugin ?
So here it is.Regards,
# Name : door_lintel # Description : Draws a lintel above door between wall sides, and window as well # Author : D. Bur # Usage : select face and "Door by reveal" in context menu # Date : May 2008 # Type : Tool # History: 1.0 (May 2008) - first version # 1.1 (May 2008) - window added require 'sketchup.rb' # f=Sketchup.active_model.selection[0] def trad(word) # tStrings = [["Door" "Porte"],["Window" "Fenetre"]] tStrings={ "Door" => "Porte", "Window" => "Fenêtre"} return word if Sketchup.get_locale != "fr" return tStrings[word] end def dbe_by_embrasure(type) model=Sketchup.active_model entities=Sketchup.active_model.active_entities @dbe_door_height=2.m if not @dbe_door_height @dbe_window_height=135.cm if not @dbe_window_height @dbe_sill_height=1.m if not @dbe_sill_height org_face=model.selection[0] model.start_operation "Door-window by reveal" if model.selection.empty? UI.messagebox("Empty selection: please select a vertical face.") return end if (model.selection.length !=1) UI.messagebox("Please select only ONE vertical face.") return end if (model.selection[0].class != Sketchup::Face) UI.messagebox("Please select a vertical face.") return end if org_face.normal.z>1e-012 or org_face.normal.z<-1e-012 UI.messagebox("Please select a VERTICAL face.") return end if org_face.outer_loop.edges.length != 4 UI.messagebox("Please select a RECTANGULAR vertical face.") return end # Parse edges edges=org_face.edges @verticals={} @horizontals={} edges.each do |e| if e.start.position.z==e.end.position.z @horizontals[e]=e.start.position.z else @verticals[e]=e.start.position.distance e.end.position end end # Dialog #puts "type " + type.inspect if type=="door" return if !dbe_door_height() else return if !dbe_window_height() end # heights control if type=="door" height_ok=false until height_ok if @dbe_door_height<@verticals.values.max #or (@dbe_sill_height+@dbe_window_height)<@verticals.values.max height_ok =true else UI.messagebox("Incorrect height for this door.\nPlease set it to a lower value than " +@verticals.values.max.to_s) return if !dbe_door_height() end end end if type=="window" heights_ok=false until heights_ok if (@dbe_sill_height+@dbe_window_height)<@verticals.values.max heights_ok =true else UI.messagebox("Incorrect heights for this windows.\nSum of sill and window heights should'nt exceed " + @verticals.values.max.to_s) return if !dbe_window_height() end end end # Highest edge & lintel height high_edge=@horizontals.index(@horizontals.values.max) bottom_edge=@horizontals.index(@horizontals.values.min) lintel_height=@verticals.values.max-@dbe_door_height if type=="door" lintel_height=@verticals.values.max-(@dbe_window_height+@dbe_sill_height) if type=="window" # New face of lintel p1=high_edge.start.position p2=high_edge.end.position p3=Geom::Point3d.new(p1.x,p1.y,(p1.z-lintel_height)) p4=Geom::Point3d.new(p2.x,p2.y,(p2.z-lintel_height)) # Mid point of lintel v=p2.vector_to p3 v.length=v.length/2.0 mid=p2.offset(v) # Opening width v_norm=org_face.normal touch=model.raytest([mid,v_norm]) if touch same_object=true hitpoint=touch[0] hit_obj=touch[1] if hit_obj.length>1 hit_face=hit_obj.last hit_parent=hit_obj[0] if not hit_parent.entities.include? org_face same_object=false end else hit_parent=hit_obj.last hit_face=hit_obj.last end width=mid.distance hitpoint if width > 200 go=UI.messagebox("Suspicious door width found: " + width.to_s + "\nProceed ?",MB_OKCANCEL) return nil if go==2 end case hit_parent.typename when "Face" if org_face.normal!=hit_face.normal.reverse UI.messagebox("Opposite reveal not parallel to selected face. Aborting...") return nil end else if same_object==false UI.messagebox("Cannot find opposite wall,\nobstructive "+hit_parent.typename+" found on layer "+hit_parent.layer.name+ ".\nPlease hide it and retry.") return end end else UI.messagebox("No opposite wall to connect lintel.") return nil end new_face=entities.add_face p1,p2,p4,p3 if touch and same_object==true v2=new_face.normal v2.length=width new_face.pushpull width else UI.messagebox("Cannot pushpull lintel.") end #Redraw these fucking remaining edges to better kill them e1=entities.add_line(p1.offset(v2),p2.offset(v2)) e2=entities.add_line(p1.offset(v2),p3.offset(v2)) e3=entities.add_line(p2.offset(v2),p4.offset(v2)) e1.erase! e2.erase! e3.erase! if type=="window" # New face of sill p1=bottom_edge.start.position p2=bottom_edge.end.position p3=Geom::Point3d.new(p1.x,p1.y,(p1.z+@dbe_sill_height)) p4=Geom::Point3d.new(p2.x,p2.y,(p2.z+@dbe_sill_height)) # Mid point of sill v=p2.vector_to p3 v.length=v.length/2.0 mid=p2.offset(v) # Opening width touch=model.raytest([mid,v_norm]) if touch same_object=true hitpoint=touch[0] hit_obj=touch[1] if hit_obj.length>1 hit_face=hit_obj.last hit_parent=hit_obj[0] #if not hit_parent.entities.include? org_face #same_object=false #end else hit_parent=hit_obj.last hit_face=hit_obj.last end width=mid.distance hitpoint if width > 200 go=UI.messagebox("Suspicious window width found: " + width.to_s + "\nProceed ?",MB_OKCANCEL) return nil if go==2 end case hit_parent.typename when "Face" if v_norm!=hit_face.normal.reverse UI.messagebox("Opposite reveal not parallel to selected face. Aborting...") return nil end else if same_object==false UI.messagebox("Cannot find opposite wall,\nobstructive "+hit_parent.typename+" found on layer "+hit_parent.layer.name+ ".\nPlease hide it and retry.") return end end else UI.messagebox("No opposite wall to connect linter.") return nil end new_face=entities.add_face p1,p2,p4,p3 if touch and same_object==true v2=new_face.normal v2.length=width new_face.pushpull width else UI.messagebox("Cannot pushpull sill.") end #Redraw these fucking remaining edges to better kill them e1=entities.add_line(p1.offset(v2),p2.offset(v2)) e2=entities.add_line(p1.offset(v2),p3.offset(v2)) e3=entities.add_line(p2.offset(v2),p4.offset(v2)) e1.erase! e2.erase! e3.erase! end # if window model.commit_operation end def dbe_door_height @dbe_door_height=2.m if not @dbe_door_height prompt=["Door height: "] value=[@dbe_door_height] results=inputbox prompt,value,"Door height" puts results.inspect return false if !results @dbe_door_height=results[0] end def dbe_window_height @dbe_window_height=135.cm if not @dbe_window_height @dbe_sill_height=1.m if not @dbe_sill_height prompts=["Sill height: ","Window height: "] values=[@dbe_sill_height,@dbe_window_height] results=inputbox prompts,values,"Window heights" return false if !results @dbe_sill_height=results[0] @dbe_window_height=results[1] end def valid_door_selection s=Sketchup.active_model.selection return false if s.length!=1 return false if s[0].typename!="Face" return false if s[0].normal.z>1e-012 or s[0].normal.z<-1e-012 return false if s[0].outer_loop.edges.length != 4 return true end #---------------------------------------------------------------------------- # add menu items if !file_loaded?(__FILE__ ) dbe_menu=UI.menu("Tools").add_submenu("Door/Window by reveal") dbe_menu.add_item("Door") { dbe_by_embrasure "door"} dbe_menu.add_item("Window") { dbe_by_embrasure "window" } dbe_menu.add_separator # Context menu UI.add_context_menu_handler do |menu| if( valid_door_selection ) menu.add_separator menu.add_item("Door by reveal") { dbe_by_embrasure "door" } menu.add_item("Window by reveal") { dbe_by_embrasure "window" } menu.add_separator end end end file_loaded(__FILE__ )
-
@Didier-Bur
It seems that no one has fixed this plugin -
@guanjin
It doesn't work in v2024 [various errors], e.g.Error: #<NoMethodError: undefined method 'index' for {#Sketchup::Edge:0x0000019daaeab1b0=>0.0, #Sketchup::Edge:0x0000019daaeab160=>39.37007874015748}:Hash>
C:/Users/TIG/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/GEIS_door_lintel2.rb: 100:in 'dbe_by_embrasure'
C:/Users/TIG/AppData/Roaming/SketchUp/SketchUp 2024/SketchUp/Plugins/GEIS_door_lintel2.rb: 274:in `block in <top (required)>'@Didier-Bur also obfuscates his code, so without arduously repacking it back into RB code it'd be difficult to say what the issues are...
Advertisement