Quick Selection
-
thankyou, that worked for me !
-
Hi,
All worked for a while in 2014, but in 2015 and last updated version 2014, I get this error when trying to use the quick selection tool...
"Starting quick selection...
Parsing objects with option: All visible objects
Error: #<NameError: uninitialized constant Set>
(eval):63:inbuild_searchable_entities' (eval):495:in
quick_selection'
(eval):691:inqs' (eval):710:in
block in <top (required)>'
-e:1:in `call'"any ideas please ?
-
@paddyclown said:
Error: #<NameError: uninitialized constant Set>
Sketchup removed
Set
it now usersSketchup::Set
you could add
require('set')
at the top of the script...
it may then work, otherwise it needs a proper fix...
john -
John, Thanks for the idea... it just made SU bugsplat on start... so i undid the change in order to work; I guess we just have to hope D Bur has a moment to update this plugin which was brilliant !
-
You can replace all occurrences in the script from
Set.new
withSketchup::Set.new
-
Jim,
Thankyou ! BingoBongo it works !
best, -
@driven said:
would it not be better to do a search and replace changing Set to Sketchup::Set in the script...
Yes.
I edited my example to remove the code snippet - it's a very bad idea.
-
@driven said:
@jim said:
This should work.
> > if defined?(Sketchup;;Set) > > Set = Sketchup;;Set > > end > >
I was going to suggest that, but what happens if another ruby has already used
require 'set'
?would it not be better to do a search and replace changing
Set
toSketchup::Set
in the script...
johnThat shim should be done in the extension namespace - then it's all fine. It should NOT be done in the global namespace as that will clash.
-
I edited my snippet - it was a bad example without the namespace.
Better to just find and replace
Set.new
withSketchup::Set.new
-
@jim said:
This should work.
> Edit; removed Jim's example >
I was going to suggest that, but what happens if another ruby has already used
require 'set'
?would it not be better to do a search and replace changing
Set
toSketchup::Set
in the script...
john -
The easiest fix for Ruby 2 and higher, is to use a refinement that only that file can "see" and use.
I inserted the following at the top of the file (after deleting theSet
reassignment):require 'set' # Create a refinement for the Set class: module DBUR module RefinedSet refine ::Set do alias :insert :add alias :contains? :include? end end end # Use the refinement: using DBUR::RefinedSet
By request from @paddyclown, here is the "fixed" file.
It still needs a drastic overhaul, but this will get it working (fingers crossed):@Didier-Bur ping (I do not know how to send this by PM in this new forum interface.)
Advertisement