sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Door-Lintel Update + Window-Sill

    Scheduled Pinned Locked Moved Plugins
    66 Posts 29 Posters 40.4k Views 29 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      naealmeida Newcomers
      last edited by

      Hello! Can you update the plugin for the new skecthup 2024 please

      1 Reply Last reply Reply Quote 0
      • A Offline
        aricfish
        last edited by

        Hi All,

        Is this plugin working in 2024 sketchup? Huge time saver but not working for me in newest version.

        Didier BurD 1 Reply Last reply Reply Quote 0
        • Didier BurD Offline
          Didier Bur @aricfish
          last edited by

          @ 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__ )
          
          
          

          DB

          guanjinG 1 Reply Last reply Reply Quote 0
          • guanjinG Offline
            guanjin @Didier Bur
            last edited by

            @Didier-Bur
            It seems that no one has fixed this plugin😞

            TIGT 1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator @guanjin
              last edited by

              @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...

              TIG

              1 Reply Last reply Reply Quote 0
              • guanjinG Offline
                guanjin
                last edited by

                So many experts, no one can fix this plugin
                The forum is no longer the same as before

                1 Reply Last reply Reply Quote -2
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  @Didier-Bur needs to fix this - it's his baby...

                  TIG

                  Didier BurD 1 Reply Last reply Reply Quote 0
                  • Didier BurD Offline
                    Didier Bur @TIG
                    last edited by

                    Hi all,
                    My baby is quite old now 😉
                    Here is the non-encrypted version. Please unpack in your Plugins dir.
                    No update because I haven't SU2024.
                    Regards,DBUR_Lines2Tubes.zip

                    DB

                    Didier BurD 1 Reply Last reply Reply Quote 0
                    • Didier BurD Offline
                      Didier Bur @Didier Bur
                      last edited by

                      Me again,
                      Same goes for door_lintel.rb

                      door_lintel_uncrypted.zip

                      DB

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        JGA
                        last edited by

                        Didier, thanks for sharing.

                        Regards,
                        JGA

                        1 Reply Last reply Reply Quote -1
                        • guanjinG Offline
                          guanjin
                          last edited by

                          Thank you to Didier Bur for the source code, which successfully fixed the work in 2024 and modified the multi-faceted selection stretching.
                          
                          Thank you again, Didier Bur![alt text](image url)无标题项目.gif

                          guanjinG 2 Replies Last reply Reply Quote 0
                          • guanjinG Offline
                            guanjin @guanjin
                            last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • guanjinG Offline
                              guanjin @guanjin
                              last edited by

                              @guanjin said in [Plugin] Door-Lintel Update + Window-Sill:

                              Thank you to Didier Bur for the source code, which successfully fixed the work in 2024 and modified the multi-faceted selection stretching.
                              Thank you again, Didier Bur
                              无标题项目.gif

                              1 Reply Last reply Reply Quote 0
                              • L Offline
                                lamngoaison
                                last edited by

                                i got a new problem. SU2025. any one fix it for SU2025 yet? please!!

                                TIGT 1 Reply Last reply Reply Quote 0
                                • TIGT Offline
                                  TIG Moderator @lamngoaison
                                  last edited by

                                  @lamngoaison

                                  The linked post contains a ZIP file posted a few days ago
                                  link
                                  Which can be converted to an RBZ by changing its filetype suffix.
                                  It worked in v2024, so should also work in v2025 ?

                                  TIG

                                  L 1 Reply Last reply Reply Quote 0
                                  • L Offline
                                    lamngoaison @TIG
                                    last edited by

                                    @TIG thanks alot 😁

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      memaridrue81
                                      last edited by

                                      hi Didier Bur,

                                      May I request an update for this extension for SketchUp 2023 and higher? it work well with my SKP 2022 but file crashes when I use it in skp 2023 😊

                                      Many thanks!

                                      1 Reply Last reply Reply Quote 0
                                      • 1
                                      • 2
                                      • 3
                                      • 4
                                      • 3 / 4
                                      • First post
                                        Last post
                                      Buy SketchPlus
                                      Buy SUbD
                                      Buy WrapR
                                      Buy eBook
                                      Buy Modelur
                                      Buy Vertex Tools
                                      Buy SketchCuisine
                                      Buy FormFonts

                                      Advertisement