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

    [Plugin] bim-tools 0.13.4(june 22, 2015)

    Scheduled Pinned Locked Moved Plugins
    206 Posts 37 Posters 218.9k Views 37 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.
    • brewskyB Offline
      brewsky
      last edited by

      @driven said:

      seemingly valid on mac

      <meta http-equiv='refresh' content='30' />
      

      Would this not mean that the webdialog is only refreshed every 30 seconds?
      I'm planning to refresh the webdialog on every selection change in sketchup, I guess it will not work in that case, right?

      @driven said:

      with this you only need the one temp file

      		@tmpPath=(@pathname + '/btDialog.html')
      > 		@tmpFile=(File.open(@tmpPath, 'w+'))
      

      with relative links for js, images and css, much cleaner.

      Is the @pathname in this case "/tmp" or the normal path to the SketchUp plugins folder?
      Otherwise I don't really understand the "relative links".

      Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        These is all the changes except a copy of the image file is also added to ui folder, there's a couple of puts that aren't needed...

        I tried a 1second refresh, but you can't change anything that quick... also tried 3 + 3000
        The 30 second refresh, allows enough time to make changes and submit, but time may be irrelevant (as long as it's enough), having this appears to allow resetting in general, which doesn't happen by default in WD's, does the ruby observer rewrite the html on selection changes? I have to re click the house to get the next elements info? The webdialog doesn't auto update that...

        #       bt_dialog.rb
        #       
        #       Copyright (C) 2011 Jan Brouwer <jan@brewsky.nl>
        #       
        #       This program is free software; you can redistribute it and/or modify
        #       it under the terms of the GNU General Public License as published by
        #       the Free Software Foundation, either version 3 of the License, or
        #       (at your option) any later version.
        #       
        #       This program is distributed in the hope that it will be useful,
        #       but WITHOUT ANY WARRANTY; without even the implied warranty of
        #       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        #       GNU General Public License for more details.
        #       
        #       You should have received a copy of the GNU General Public License
        #       along with this program.  If not, see <http://www.gnu.org/licenses/>.
        
        class Bt_dialog
        
          def initialize(project)
            @project = project
            bt_lib = @project.library
        		    
            # Create WebDialog instance
            @dialog = UI;;WebDialog.new("BIM-Tools menu", false, "bim", 243, 150, 150, 150, true)
           		 @dialog.min_width = 243
        		 @dialog.min_height = 25
        		 @dialog.max_width = 243
        		 @dialog.max_height = 1200
        		 @dialog.set_position(150,150) 
            
            @pathname = File.expand_path( File.dirname(__FILE__) )
            mainpath = @pathname.split('ui')[0]
            @imagepath = mainpath + "images" + File;;SEPARATOR
            @bt_lib = bt_lib
            @javascript = ""
            
            # create BIM-Tools selection object
            require 'bim-tools/lib/clsBtSelection.rb'
            @selection = ClsBtSelection.new(@project, self)
            
            @h_sections = Hash.new
            
            # define sections
            require 'bim-tools/ui/clsEntityInfo.rb'
            entityInfo = ClsEntityInfo.new(self)
            @h_sections["EntityInfo"] = entityInfo
            #@h_sections["ProjectData"] = ClsProjectData.new
             		# PC Load paths will have a ';' after the drive letter.  
        		@is_mac = ($LOAD_PATH[0][1..1] != ";")
        		puts 'mac'
        	
             
        		#@tm=(rand(9999).to_s.strip)
        		@tmpPath=(@pathname + '/btDialog.html')
        		@tmpFile=(File.open(@tmpPath, 'w+'))
        		@tmpFile.rewind
        		@tmpFile.puts html
        		@tmpFile.rewind	
        		@dialog.show_modal
        		@dialog.set_file(@tmpPath)
        
          if File.exists?(@tmpFile) 
        	@tmpFile.close
        	puts 'closed'
             end
            # Attach the observer.
            Sketchup.active_model.selection.add_observer(MySelectionObserver.new(@project, self, entityInfo))
        		
          end
          def refresh
            @dialog.set_file( html ) 
          end
          def html
            content = ""
            @h_sections.each_value do |section|
              content = content + section.html
            end
            return html_top + content + html_bottom
          end
          def html_top   #Note that XHTML 1.0 previously defined that documents adhering to the compatibility guidelines were allowed to be served as text/html, but HTML 5 now defines that such documents are HTML, not XHTML.
            return "
            <!DOCTYPE html>
            <html>
            <head>
            <meta charset='UTF-8' />
            <meta http-equiv='refresh' content='30' />
            <title>BIM-Tools - webdialog</title>
            <link href='" + @pathname + "/bt_dialog.css' rel='stylesheet' type='text/css' />
            </head>
            <body>
            "
          end
          def html_bottom
            return "
            </body>
            </html>
            "
          end
          def webdialog
            return @dialog
          end
          def close
            if @dialog.visible?
              @dialog.close
            end
          end
          def selection
            return @selection
          end
          def imagepath
            return @imagepath
          end
          def project
            return @project
          end  # This is an example of an observer that watches the selection for changes.
          class MySelectionObserver < Sketchup;;SelectionObserver
            def initialize(project, bt_dialog, entityInfo)
        			@project = project
        			@bt_dialog = bt_dialog
        			@entityInfo = entityInfo
        		end
        		def onSelectionBulkChange(selection)
        			# open menu entity_info als de selectie wijzigt
        			#js_command = "entity_info(1)"
        			#@dialog.execute_script(js_command)
        
        			
        			#js_command = 'entity_info_width("' + width.to_s + '")'
        			#@dialog.execute_script(js_command)
        			@entityInfo.update(selection)
        			#@bt_dialog.webdialog.set_html( @bt_dialog.html )
        		end
        		def onSelectionCleared(selection)
        			@entityInfo.update(selection)
        			#@bt_dialog.webdialog.set_html( @bt_dialog.html )
        		end
        	end
        end
        
        

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • brewskyB Offline
          brewsky
          last edited by

          Demo version, still contains bugs
          Updated version:

          • Removed image path from css
          • added webdialogpatch.rb(still contains the temp path)
          • changed html type

          John, I was just uploading this new version when i saw your post, I will compare it with the version you just posted and post another one. Thanks!

          Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            I'll give this a spin, I don't see an issue with having concurrent test variations at this stage, for me it's more a test of WD's on mac, different flavors gives me somethings to test against. john

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • brewskyB Offline
              brewsky
              last edited by

              @driven said:

              does the ruby observer rewrite the html on selection changes? I have to re click the house to get the next elements info?

              (here on PC) every time a new set_html, for:

              • if no building element selected: show message and further empty window
              • if you select a (different) building element the dialog updates to show the selected elements info
              • if multiple building elements are selected it shows the values that are the same for all selected elements
                There is no dynamic javascript/AJAX content.

              Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                So, it's basiclly working, churning out .htmls into --TMP-- folder.

                just read your cross post, because it disappears behind the window I need to re-click the house to see the dialog, and this updates the selection,

                It is also updating when I change selection in view, I just couldn't see it... so I moved the drawing and I can...

                it does need .show_modal to make any sense... john

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                1 Reply Last reply Reply Quote 0
                • brewskyB Offline
                  brewsky
                  last edited by

                  @driven said:

                  So, it's basiclly working

                  Cool!

                  @driven said:

                  churning out .htmls into --TMP-- folder.

                  Ooops, didn't think of this temp folder spamming. Maybe best to just delete the old tmp-html when a new one is loaded? I don't think the timer will work for my dialog because of the many content changes.

                  @driven said:

                  it does need .show_modal to make any sense... john

                  Yes, I forgot to add the show for pc, and show_modal for Mac, I'm currently fixing that...

                  Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    driven
                    last edited by

                    @brewsky said:

                    Ooops, didn't think of this temp folder spamming. Maybe best to just delete the old tmp-html when a new one is loaded? I don't think the timer will work for my dialog because of the many content changes.

                    Can the 'old' tmp file can be deleted immediately after it's loaded?

                    I'm going to do more test with the timer as it may be useful for other stuff, if not this...

                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                    1 Reply Last reply Reply Quote 0
                    • PixeroP Offline
                      Pixero
                      last edited by

                      Just found that line 19 in clsBimTools.rb shows the console everytime I start SU. Had to edit it away.

                      1 Reply Last reply Reply Quote 0
                      • brewskyB Offline
                        brewsky
                        last edited by

                        @pixero said:

                        Just found that line 19 in clsBimTools.rb shows the console everytime I start SU. Had to edit it away.

                        Ah thanks for mentioning! That's an old line I have used for easy debugging. I stripped it out...

                        Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

                        1 Reply Last reply Reply Quote 0
                        • brewskyB Offline
                          brewsky
                          last edited by

                          Today "officially" posted the new version I have been working on.
                          See the first post...

                          Still need to fix bugs(infinite loops/too much overhead etc.)
                          Also have to improve on the webdialog temp files.
                          And IFC support...

                          But I'm getting there!

                          Cheers,
                          Jan

                          Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

                          1 Reply Last reply Reply Quote 0
                          • Z Offline
                            ZFRPS
                            last edited by

                            Good job!refuel!

                            sketchup is bim

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

                              @brewsky said:

                              Today "officially" posted the new version I have been working on.
                              See the first post...

                              Still need to fix bugs(infinite loops/too much overhead etc.)
                              Also have to improve on the webdialog temp files.
                              And IFC support...

                              But I'm getting there!

                              Cheers,
                              Jan

                              Open the tool always show this, do not know how to use
                              No BIM-Tools entities selected

                              I come from China, is to learn

                              1 Reply Last reply Reply Quote 0
                              • brewskyB Offline
                                brewsky
                                last edited by

                                @guanjin said:

                                Open the tool always show this, do not know how to use
                                No BIM-Tools entities selected

                                I need to make a little tutorial to explain how it works, I will try to that after the weekend.

                                You first need to select some faces and press the second button in the toolbar, the faces will be "converted" to BIM-objects.
                                The message "No BIM-Tools entities selected" will be replaced by object-properties when you select a BIM-object.

                                I hope this gets you started 😄

                                Thanks for trying anyway!

                                Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

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

                                  Thank you, I do not see video

                                  I come from China, is to learn

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

                                    @guanjin said:

                                    Thank you,China
                                    ,I do not see video

                                    I come from China, is to learn

                                    1 Reply Last reply Reply Quote 0
                                    • Z Offline
                                      zensor
                                      last edited by

                                      Thanks you very much

                                      1 Reply Last reply Reply Quote 0
                                      • brewskyB Offline
                                        brewsky
                                        last edited by

                                        @guanjin said:

                                        Thank you, I do not see video

                                        Hi Guanjin,

                                        Check the first post, I have added a little tutorial with images.
                                        I hope this helps you out because I don't exactly understand what you mean by "video".

                                        Cheers,
                                        Jan

                                        Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

                                        1 Reply Last reply Reply Quote 0
                                        • brewskyB Offline
                                          brewsky
                                          last edited by

                                          New version 0.10.3 uploaded!

                                          I wonder what you think, especially about the workflow!
                                          Is it intuitive, sketchup-like? What must be improved?

                                          I made the interface as lean as possible, not a separate button for walls/roofs/floors, just thick faces with properties.
                                          Is this the way to go?

                                          I know it still has bugs(losing relations, sometimes crashing), "bugreports" are also welcome!

                                          Cheers!
                                          Jan

                                          Sketchup BIM-Tools - http://sketchucation.com/forums/viewtopic.php?p=299107

                                          1 Reply Last reply Reply Quote 0
                                          • JQLJ Offline
                                            JQL
                                            last edited by

                                            @brewsky said:

                                            New version 0.10.3 uploaded!

                                            I wonder what you think, especially about the workflow!
                                            Is it intuitive, sketchup-like? What must be improved?

                                            I just downloaded it and it's impressive. I couldn't believe my eyes when I saw almost the same workflow I use in SU, reproduced with 3 buttons. The main difference is I create a group for all exterior walls/roofs and if I need to edit one or more specific walls/roof slabs, I then divide those groups. In this way it is simpler for me to edit everything... This plugin might change that though.

                                            I also like the way face offset works. Setting it to zero makes it very simple to work volumes, extruding them in. However, when you toggle to element view, I think it should hide the source faces. Of course this is only visible when offset has a given value, and for me this would happen only when working on interior walls. Nevertheless it would be a very nice feature to implement if it is possible.

                                            This is also true for corners. The plugin also creates border faces for each wall/slab corner wich should not appear when you create a section. It would be nice if these border faces could also be hidden. If the plugin could do this, then we could create a section only with the finishing lines active and no diagonals in the corners.

                                            @brewsky said:

                                            I made the interface as lean as possible, not a separate button for walls/roofs/floors, just thick faces with properties.
                                            Is this the way to go?

                                            Definetely the way to go. Simple, effective, clean. The way it should be in Sketchup. I would have a request for one more button though. It would be wonderful if there would be also a button to disconnect/reconnect the faces created. You could then disconnect the faces of a wall for instance, edit that wall, and then reconnect all the faces. This would be most welcome when you want to create special non-uniform walls, walls with unparalell faces or any kind of correction to geometry in dificult corners where some gaps and misajustments happen. It could also be used to correct the bugs you mention below like losing relations between source faces and elements. If one can disconect a face that is not working and erase all associated geometry (but not window components), one would also be able to rebuild it from scratch "debugging" the model. Of course some of the features of windows and dynamic thickness would be lost, but project freedom and overall organization would be kept.

                                            @brewsky said:

                                            I know it still has bugs(losing relations, sometimes crashing), "bugreports" are also welcome!

                                            The main inconvenience I found is that if the user doesn't follow the specific steps to make it work right, faces and elements start to fail and some of them disappear. In a creative and interactive process, specially on early stages of a project, this might mean that sometimes you will have to discard the whole model and start over for it to work.

                                            In the present state it is definetely a very useful plugin for simple geometry projects. However for more complex ones I think users would benefit if they had more flexibility with the disconnect/reconnect faces button.

                                            Having said everthing I felt, I think this will be an extremely useful plugin if it gets a little more solid. It could very well be, one of those that really enhances SU. Congratulations!

                                            www.casca.pt
                                            Visit us on facebook!

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 6 / 11
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement