Dear friends,
In following codes, we make 2 red box in different ways, we can change color of one of them by clicking on it. How can I change color of both of these boxes by clicking on them?
The “magic comment” for encodingmust be the very first line in a file, or the second line if the first line is a “shebang”. (Ruby embedded script files do not use nor need “shebang” lines because they are not run outside of SketchUp.)
DO NOT add the "Untagged" layer-tag.
It is ALWAYS in the Sketchup::Layers collection.
Use simple reasoning. To find objects to affect with code, your code will search for theses objects.
To find the objects your code wants, give them a name. Then read this prior topic …
I gave a solution to both versions in a different topic.
Unfortunately, there isn’t much chance that copying the code rows here and there will work.
First, try to understand both versions. Separately. It certainly won’t work in a matter of seconds.
Take as much time as you need. Check line by line, letter by letter until you understand.
As Dan mentioned, the biggest problem is that you don’t pay attention and don’t even accept suggestions written in bold. Even if we describe it several times.
I am trying to follow your advice and many times I review them but sometimes I cannot understand it. Even I cannot understand I keep them on my mind and think about it. Dan advice me for file format and I tried it seriously. Give me time and keep advice me, I will improve. I know you gave me solution to both versions in different topic and I can use both but I think maybe there is another way that can work with both versions. If I have to use 2 ways, just let me know.
For “magic comment” I thought simply we can ignore gray codes and I just use it to follow your advice to write plugins code. Now I know it is important.
The __FILE__ interpreter function only works when you load the Ruby file from disk.
It returns "<main>" if you copy and paste the code into a Ruby console.
All the block does is prevent multiple menu items being created when the file is reloaded during testing.
You can put that part in a separate file by itself if it gives you problems during development.
And I just tested it on my machine, and it loads fine.
There are other runtime exceptions happening that are not related to this.
I activate codes and put it in plugine directory, it works well as you said and again, ruby code editor cannot run it. Also it prevent multiple menu and every time I have to reload sketchup program. If you agree, I will activate codes after I finish testing/ learning. As Dezmo said, I need better understanding each line of codes.
You should not put code files directly into the "Plugins" directory.
Each extension should be in it’s own subfolder that uses the correct unique name.
Ie … "MajidMahmoudi_BoxTest/Boxtest.rb"
And then in the "Plugins" directory you have an extension registrar script that allows the user to switch the extension on or off using the Extension Manager.
Dear Dan, I know it is old topic but I have to back to this topic. For plugin usually we download an main “rbz” file from Extension Wearhouse then in Extension Manager install it. When we install it, automatically a directory and a rb file will make. As I understand rb file have some basic information and use an rbz file in made directory. Would you please let me know how can we make main rbz file from our own rb file?
Dear Dezmo, I finish my first plugin and plan to distribute it for free. Without you and Dan help I could never do it and I really wish to have especial thanks to you somewhere in software if you let me. Before Aug 1st I never heard about Ruby and from 30 years ago that I wrote assembly codes I never write any code. To be honest I scare send my plugin to SketchUp team and wish to know your idea about it before.
Attached you can find it in “rbz” format.maj_group_wall_maker_v0.0.1.rbz (5.6 KB)
Dear Dan, I finish my first plugin and plan to distribute it for free. Without you and Dezmo help I could never do it and I really wish to have especial thanks to you somewhere in software. I wish to know your idea about it before I distribute it I wish to know your idea. Thank you in advance. maj_group_wall_maker_v0.0.1.rbz (5.6 KB)
You must use Tooll#getExtents-instance_method otherwise : “If you don’t implement this method, you may find that part of what the tool is drawing gets clipped to the extents of the rest of the model.”
Extremely long lines in the code. I can’t follow.
Variable names should be more self-explanatory. I can’t follow.
There is no explanation about the first Wall Information window. I have not been able to evaluate what is meaning what?
The “copyright notice” s are not clear. I’m not a lawyer but for sure something are wrong with these…
.
.
.
Beside that your plugin two times “bugsplat”-ed SU I cannot judge, I just removed and deleted.
I’m not using any other wall plugin yet, but there are plenty: