[Plugin] bim-tools 0.13.4(june 22, 2015)
-
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
-
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!
-
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
-
@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.
-
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
-
@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...
-
@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...
-
Just found that line 19 in clsBimTools.rb shows the console everytime I start SU. Had to edit it away.
-
@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...
-
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 -
Good job!refuel!
-
@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,
JanOpen the tool always show this, do not know how to use
No BIM-Tools entities selected -
@guanjin said:
Open the tool always show this, do not know how to use
No BIM-Tools entities selectedI 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!
-
Thank you, I do not see video
-
@guanjin said:
Thank you,China
,I do not see video -
Thanks you very much
-
@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 -
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 -
@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!
-
@jql said:
I just downloaded it and it's impressive.
Thanks! And thanks for your input! I have already added a few of your ideas!
@jql said:
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.
I think I normally work in a similar way, but that's one of the things in my workflow I would like to change with this plugin, if it works right the plugin could reduce the number of groups/components that you have to edit/keep up-to-date.
@jql said:
Setting it to zero makes it very simple to work volumes, extruding them in.
Great idea! didn't think of using it like that but it gives more direct control over the walls.
@jql said:
However, when you toggle to element view, I think it should hide the source faces.
It should hide the source faces, only edges should be visible. I think I can easily hide them but didn't work on that yet because i have some ideas for the edges I didn't get to yet. But maybe it's a good idea to temporarily fix this!
@jql said:
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.
Great idea! fixed in the new 0.10.4 version!
@jql said:
It would be wonderful if there would be also a button to disconnect/reconnect the faces created.
I have to think a bit about the disconnect button, wouldn't it be better to just disconnect a single edge? For example when a wall must connect to another wall, but not to the roof?
Meanwhile I have created a button for "deleting BIM properties", works great for fixing bugs!@jql said:
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.
Yes, that's the biggest reason why it's not "production-ready", but this new button helps a bit in the "fixing".
One thing that fixes some problems is just save your work and re-start SketchUp, the plugin will then re-load the "BIM-properties".
A big problem is still that you have to close SketchUp between switching models, otherwise relations are lost.Let me know what you think of this new button
Advertisement