Those are great and detailed construction details Craig. Thanks for sharing.
There's a lot of detail in there that would tax me if I were to make revisions. What plugins do you use to speed up your workflow?
Those are great and detailed construction details Craig. Thanks for sharing.
There's a lot of detail in there that would tax me if I were to make revisions. What plugins do you use to speed up your workflow?
@kiwi15 said:
Hi TommyK,
This new way is indeed a much better way to tweak component properties. Apparently you are not the only one who have found the native Component Browser cumbersome: https://extensions.sketchup.com/en/content/component-properties
Thanks for a cool and promising plugin:)
Thanks, kiwi. Yes ThomThom's plugin is indeed worth mentioning in this thread.
I must admit I have other distractions at the moment, so development on this is slow. Glue properties are high on my list for this plugin.
Plugin has been updated. This is still an alpha release, but there are big improvements.
Release Notes
v 0.2.0
Developer Contributions Welcome
There is a dizzying array of potential properties that can be edited in SketchUp, which will take a lot of coding to complete. I have developed a way to organise each property in this plugin, so developers (myself included) will be able to write just 4 methods (propertyName, get, set, validate) for each property that they wish to add to the mix.
If you are interested, have a look at the propertyType.rb file in the plugin, and see if you can't write the code needed to get your favourite property into the plugin. I will be happy to review and integrate contributions.
###############
### EXAMPLE ###
###############
# Each new property type needs to define 4 methods as in the example below.
# Note that all methods are class methods, so it can be called without creating
# an instance of the class.
# The first method simply defines the name of the property type, and the name of
# the 'get', 'set' and 'validate' methods it uses.
def self.example
# getNameFunc is an optional variable, which builds the name from parameters
#passed to the method. This is required for property types such as atributes,
# which need to include the attribute dictionaries and attribute label in the name
values = {'name' => 'example', \
'label' => 'Example', \
'getNameFunc' => 'exampleName', \
'getValueFunc' => 'getExample', \
'setValueFunc' => 'setExample', \
'validateFunc' => 'validateExample'}
return values
end
def self.exampleName(options)
name = 'example;' + options.to_s
return name
end
# The get method takes a Sketchup;;Selection object, and any parameters required.
# Parameters are required when getting deeper structured information about attributes
# or Classifications, for example.
#
# Params;
# +selection+;; Sketchup;;Selection object from which to get the values from.
# +params+;; Additional parameters required to get the value (optional).
def self.getExample(selection, params)
result = {}
result['label'] = 'example' # the label shown to the user (optional - defaults to existing label)
result['hidden'] = false # if true, the input box on the editor window will be hidden (optional - defaults to false)
result['message'] = "This is a message, not that you need it" # this shows the help text that can be displayed on the editor window (optional)
result['warning'] = "Watch out" # a warning to be displayed prominently to the user next to the label text (optional)
result['value'] = selection[0].definition.description # the output value. Can be a string, or an array of result objects with the same values as above (required)
result['form-type'] = 'text' # the form type, can be 'text', 'textarea', 'checkbox', 'select'
return result
end
# The set method sets the property of the selection.
#
# Params;
# +selection+;; Sketchup;;Selection object to which we can apply the properties.
# +params+;; The values to set the property with.
def self.setExample(selection, params)
if selection.length > 0
# Make your edits here
stuff = params['value'] # values normally reside in this hash
params['success'] = true # mark your values as successfully set
return params # return the params
else
params['success'] = false # report that something went wrong
params['warning'] = "something went wrong" # optional message to be displayed to the user
return params # return the params
end
end
# The validate method validates the input parameters, and amends them if necessary.
#
# Params;
# +selection+;; Sketchup;;Selection object to which the properties are to be applied.
# +params+;; A hash object containing values.
def self.validateExample(selection, params)
if params['value'] == "oh no" # check for problems with values
params['error'] = true # report an error - this will stop the setting of the property
params['warning'] = "Value given is not a string" # optional message to be displayed to the user
end
return params # return the parameters for the next step; set the property.
end
The plugin imports DXF text as SketchUp Text Label entities.
Adapted from TIG's importDXFText (which can be found here: http://sketchucation.com/forums/viewtopic.php?t=23002). SketchUp Text Labels are more lightweight than the 3D Text that TIG's plugin makes.
Download from the Plugin Store:
http://sketchucation.com/pluginstore?pln=importDXFtextLabel
Run by:
Menu > File > Import DXF Text Label...
Select the DXF file [text-type] from the first dialog.
Select the DXF's Units in next dialog.
Progress is reported in the Ruby Console.
I've been getting an error that breaks your plugin for some files, TIG.
gsub': invalid byte sequence in UTF-8 (ArgumentError)`
It appears that my file had text that was not encoded in UTF-8. I added a line to your code to get it working.
txt.strip! if txt txt.chomp! if txt txt = txt.encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8') # added this line
I do like the auto label tool. I've been getting more in the habit of using it, by putting in information into the model, which I pull out within LayOut. It's a well designed system. However, more and more, I find myself going back to Sketchup to add/amend details (to a component description, more often than not), save model, refresh viewport in LayOut, before carrying on. This is a waste of time.
What has become clear for me in the pursuit of going more and more BIM, is that information about a model is more naturally manipulated within a paper layout (ie within LayOut). So users should have the ability to change the information in a SketchUp model from within LayOut.
I think the best way to do this is by expanding the features of the label tool. For example, if <ComponentDescription> is in the label text, the user should be able to, say, right click on the auto-text and select "edit property". Then the user edits the text of that property as if it was carrying on with a normal annotation, but the property gets updated on the model itself.
This changes the paradigm from "SketchUp to LayOut", to "SketchUp to/from LayOut", but I don't think this is a bad thing.
@brettsichellodesign said:
- With all of this BIM information being added in Sketchup, Layout needs to be able to pull that information into a window or door schedule without a huge amount of time required to set up the table and double check it over and over.
I think this would be possible with the new Layout C API, if only someone can build an extension that does it...
Also, with all this BIM, I think we need a way for information added in LayOut to be synced to the Sketchup model. We annotate in LayOut, so it only makes sense for LayOut to be the place from which information is added to the model... With a Ruby API in LayOut (hopefully for 2017), this should be possible with a LayOut extension.
@driven said:
Tommy, just set it as a global preference and it works for SU and Safari...
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
paste into Terminal or wrap in %x() from Ruby Console...
john
YES! IT WORKS! SO SIMPLE! THANK YOU!
I am sure I am doing something stupid, but this isn't working for me.
I have found ~/Library/Preferences/com.sketchup.SketchUp.2016.plist . Opened it with Xcode, made the additional property to the root, saved it. Then nothing. I try to go back to open the .plist file again, and it doesn't let me.... Strange? Any ideas?
So I got as far as this, using back ticks:
sql = %x(sqlite3 ~/Desktop/sp500data.sqlite "SELECT * FROM companies;")
I am getting an output.
I have two concerns:
FYI I am using a database from here: http://ruby.bastardsbook.com/files/projects/sp500/sp-500-historical-stock-prices.zip
Thanks for your engagement - it is getting me somewhere, at least.
@driven said:
Tommy, what did you try?
it's builtin so
%x(cd #{your_database} && /usr/bin/sqlite3 .help 2>&1)
, should give you the options...
else, if you have a small sample db I could have a look...
john
Thanks for your response.
I was trying to use the Ruby-sqlite3 and had no success - ie require 'sqlite3'
returns an error.
What I think you are suggesting is that I should use sqlite3 through shell commands in ruby? Is this a simple way of doing this?
By the way the following returns an empty string (am I doing something wrong):
sql = %x(cd #~/Desktop/sp500data.sqlite && /usr/bin/sqlite3 .help 2>&1)
I know this is an old thread, but I wonder if anyone has had any further successes? I have been trying for the last 3 hours to get SQLite3 working on OS X without success. Now that I read this thread, I wonder if it is even worth trying to get a local database in Ruby....
I do love this plugin. It so nearly feels native to SketchUp. For making geometry, it works great. I have a few suggestions to improve it though in the realms information (the "I" in BIM).
Components over groups, please. Currently, PB creates groups from profiles. Groups are more limited in SU than components. For instance, you can't explore "Component Options" of a group. This would be useful for people who use Classifer.
When using assemblies, it appears that PB deletes everything within the assembly group and redraws. This results in any layers or classifier information that have been assigned to the individual groups within the assembly to be lost whenever the assembly is rebuilt (when changing path, for example). Is there a way to retain each group (if it still exists), but alter the geometry within them?
Profiles and assembly components are skp files, as you say. It would be great if these are imported into SU as components and the profile is made within the component that is imported. What this does is that any information within the component is preserved in the profile member. This includes component description, Classifier information etc etc.
Other little thing:
Thanks for a great plugin! I would use it even more if it could do the information side of things.
Whaat, It would be amazing to have an API.
Could you also perhaps include a callback system when a profile member or assembly is created/edited, so that other plugins could do their magic? On the information side of things, it could be things like updating a "price" attribute, which is based on the volume of the profile output, for instance. For such a callback, the useful variables would be:
I checked Layers Panel with 2016. It works fine. Seems some people are having some problems, but I haven't come across any.
I also had a look at the code on github. It's clean code but there is a lot of it. I am a little put off the idea of helping supporting it with all of its features, and I understand why jimneybob isn't all that keen either.
@ashscott said:
Who would be able to do the coding really well?
Hmmm... I might be tempted. I'm not bad at JavaScript.
I would want to change it a little though. I would prefer to group layers according to its prefixes (separated with a hyphen), ala vectorworks and autoCAD. That should make imports from dxf and other formats cleaner without having to rearrange. Would that break the workflow for current users of layers panel?
Back on to wishlists, mine are:
CIRCLE GUIDES / TRUE CIRCLE INTERSECTIONS - I now do my surveys in sketchup. I know true circle geometry is too much to wish for, but being able to use intersections with true circles would really help. No plugin can truly provide this (TIG does have a tool that helps you, but it clearly is a workaround).
LAYERS IMPROVEMENTS
MATERIALS FOR OS X
REALTIME ANTI-ALIASING
In response to your problem with quantities. I had an issue where I used lots of instances of a component and many of the components had qty 1 and seemed to be duplicated. What caused this for me was that the instances of the components had different scales. So each unique scale created a new row in the report. This might be something that happens for all instances with different attributes (layers, name, etc?). Maybe it's something to look into? If you create a report and output all attributes, you might be able to spot the attribute that is differing for each instance.
You could also try to use mouse gestures to change tools. I haven't used it before, but have a go: http://www.tcbmi.com/strokeit/
I've noticed how inferencing has got better. Not just the new parallel/perpendicular feature. Especially noticeable when using the rotate tool - it snaps to edges now - before it only snapped to points in most situations. Inferencing in general feels much more successful. It's a big productivity plus for me, more valuable than any new feature.
API - just to clarify what the current API means to end users - it is a C API. This means that tools within LayOut cannot be developed using this. Instead, LayOut files can be created/manipulated from outside LayOut - from SketchUp for example. We would have to wait for a sketchUp Ruby style API in a future release.
ROTATE - I do have frustrations with this, but I don't mind the principle of how it works. It needs to work with inferencing better, and have an ability to change the "start rotate" angle, if that makes sense. Then, I'd be happy.
BETTER INFERENCING - LayOut inferencing should be as powerful as the Sketchup inferencing, and work in the same way. End of. Please get this done!