I've analysed your selector.rb pluggin and I haven't the slightest idea of how you select a component, lol !
I've been looking for 3 days in the jungle of Sketchup ruby for a way to select a component of my drawing (for example Component#1) and move it (for example 5 cm along axis X). And I end up even more confused than before !
> I've analysed your selector.rb > pluggin and I haven't the > slightest idea of how you select > a component, lol !
My guess is that you are new to object-oriented programming. You probably had your mind warped by starting with Basic or Fortran. (A study reported in Scientific American years ago said that your first programming language can indeed warp you for life!)
I sympathize, it took me a long time to unlearn "how to think like a computer" when that wasn't the real issue after all, and it was more about how to think about programming in a totally different way.
Here's some tips from the selector.rb code:
Sketchup.active_model.selection.clear
This clears whatever has been selected. Sketchup.active_model.selection is an "object" that can be a single thing or a collection. As an object of that type, it can have sub-objects (parameters, values) and appropriate operations (functions). In this case, "clear" is an operation on the object.
Sketchup.active_model.selection.add @ss
The operation "add" adds the variable @ss to the current selection collection. Look at how @ss is defined to determine what is being added.
Sketchup.active_model.selection.each {...}
This performs the operation in the braces on each item in Sketchup.active_model.selection
At least, I *think* so. That's how I read it, without ever having made a workign Ruby program but having experience with several other object-oriented languages.
this plugin would be even more helpful, maybe, if it would be to add to the entity type criteria, a second criteria for the search and selection: for example the color
Or when searching for a precise line: the lenght, or all vertical lines, all horizontal lines...
6 comments:
Hi,
I've analysed your selector.rb pluggin and I haven't the slightest idea of how you select a component, lol !
I've been looking for 3 days in the jungle of Sketchup ruby for a way to select a component of my drawing (for example Component#1) and move it (for example 5 cm along axis X). And I end up even more confused than before !
Maybe you can help me ?
I can try. Can you email me?
Oh sure. It's in your mail box now (I don't give my mail address in blogspot because of spams).
Thank you very much Jim.
> I've analysed your selector.rb
> pluggin and I haven't the
> slightest idea of how you select
> a component, lol !
My guess is that you are new to object-oriented programming. You probably had your mind warped by starting with Basic or Fortran. (A study reported in Scientific American years ago said that your first programming language can indeed warp you for life!)
I sympathize, it took me a long time to unlearn "how to think like a computer" when that wasn't the real issue after all, and it was more about how to think about programming in a totally different way.
Here's some tips from the selector.rb code:
Sketchup.active_model.selection.clear
This clears whatever has been selected. Sketchup.active_model.selection is an "object" that can be a single thing or a collection. As an object of that type, it can have sub-objects (parameters, values) and appropriate operations (functions). In this case, "clear" is an operation on the object.
Sketchup.active_model.selection.add @ss
The operation "add" adds the variable @ss to the current selection collection. Look at how @ss is defined to determine what is being added.
Sketchup.active_model.selection.each {...}
This performs the operation in the braces on each item in Sketchup.active_model.selection
At least, I *think* so. That's how I read it, without ever having made a workign Ruby program but having experience with several other object-oriented languages.
I hope this helps,
August
this plugin would be even more helpful, maybe, if it would be to add to the entity type criteria, a second criteria for the search and selection: for example the color
Or when searching for a precise line: the lenght, or all vertical lines, all horizontal lines...
I did the downloads, but I cannot the open the files into the sketchup. I'm so confused now!
Can you answer-me --> alinemanera@hotmail.com
Thank you very very much!
Post a Comment