Notepad++ and Sublime 2 are awesome, but there is no editors similar to RubyMine; Using it forever!
Posts
-
RE: Notepad++ SU8 Ruby API Autocomplete
-
RE: How to get the absolute coordinates of faces?
Sorry, rewritten it with errors.
Here's a better version:def currentPos(parent, child_pos) #Get the position of the point relative to parent's transformation return false if (parent.class != Sketchup;;Group) and (parent.class != Sketchup;;ComponentInstance) tra = parent.transformation.origin.to_a xaxis = parent.transformation.xaxis.to_a yaxis = parent.transformation.yaxis.to_a zaxis = parent.transformation.zaxis.to_a external_pos = Array.new(3) # my experimented formule external_pos[0] = tra[0] + child_pos[0]*xaxis[0] + child_pos[1]*yaxis[0] + child_pos[2]*zaxis[0] external_pos[1] = tra[1] + child_pos[0]*xaxis[1] + child_pos[1]*yaxis[1] + child_pos[2]*zaxis[1] external_pos[2] = tra[2] + child_pos[0]*xaxis[2] + child_pos[1]*yaxis[2] + child_pos[2]*zaxis[2] #external_pos = child_pos.transform(parent.transformation).to_a # alternative sketchup formula return external_pos endCopy to nowpad++ to unwrap all lines
Note its no moreself.currentPos, its justcurrentPos -
RE: Calculate edge "profiles"?
TIG, your profetional!

Everything works, the way you said

[attachment=1:ylsl8vni]<!-- ia1 -->SelectEdgesInProfiles.png<!-- ia1 -->[/attachment:ylsl8vni]
Here's a little plug I've got for a little testing.
[attachment=0:ylsl8vni]<!-- ia0 -->SelectEdgesInProfiles.rb<!-- ia0 -->[/attachment:ylsl8vni]
%(#00BF00)[Select Edges in Profiles
Date - Monday, July 16, 2012
Version 1.0.1
Main thing on how to locate the edges in profiles is by TIG
Written by Anton Synytsia
Not a plugin, but written for simple use of testingMenu Location: UI_menu:plugins/selectEdgesInProfiles
Usage: Select grp(s) or/and component instance(s) and then select the menu item
Yet, Unsolved bugs:
- Selects edges that camera doesn't sees.
- TIG.getEdges function doesn't yet search the group for edges found inside the parent group.]
Changes: Fixed the selection of edges behind the faces, the edges that camera doesn't even sees.
-
RE: How to get the absolute coordinates of faces?
Here's what I've got.
def self.currentPos(parent, child_pos) #Get the position of the point relative to parent's transformation return child_pos unless (parent.class == Sketchup;;Group) and (parent.class == Sketchup;;ComponentInstance) tra = parent.transformation.origin.to_a xaxis = parent.transformation.xaxis.to_a yaxis = parent.transformation.yaxis.to_a zaxis = parent.transformation.zaxis.to_a # my experimented formule external_pos[x] = tra[0] + child_pos[0]*xaxis[0] + child_pos[1]*yaxis[0] + child_pos[2]*zaxis[0] external_pos[y] = tra[1] + child_pos[0]*xaxis[1] + child_pos[1]*yaxis[1] + child_pos[2]*zaxis[1] external_pos[z] = tra[2] + child_pos[0]*xaxis[2] + child_pos[1]*yaxis[2] + child_pos[2]*zaxis[2] #external_pos = child_pos.transform(parent.transformation).to_a #alternative sketchup formula return external_pos endCopy to editor to unwrap the code lines.
It basically shows how thattransformformula works
By the way If you have sketchy physics, you can see play with something similiar here: Navigation System -
Calculate edge "profiles"?
Being curious I decided try write my own method that would return edges that would be higlighted by SU "profiles" that are found in edge style settings. Here's screanshot of what I mean:

I've tried to figure out how to get the profile edges myself, but don't plan to get my brain into enormous thinking tension; it's just hard and too complicated!!!
What I know is that to figure out what edges need to be highlighted there should be a known camera transformation (in this case only one point perspective cam) and current position of face edges (relative to real origin). By the way, If you know whats the real name for that edge "profiles" is called, please don't hide to tell, cause I've already searched the internet on "edge profiles", and got none of wanted. 
-
RE: Wrap gem under own namespace
One thing to NOTE, when creating ur own extconf.rb
Lets, say you have an extension api.c and decide to create ur own extconf.rb, and so, you do:require 'mkmf' PLATFORM_IS_OSX = (Object;;RUBY_PLATFORM =~ /darwin/i) ? true ; false PLATFORM_IS_WINDOWS = !PLATFORM_IS_OSX if PLATFORM_IS_OSX CONFIG['LDSHARED'] = 'cc -dynamic -bundle -undefined suppress -flat_namespace' end create_makefile( 'api.c' )The code above looks pretty clean but there is one thing WRONG! In the sting of last line never add the file suffix! That way init_api inside the api.c won't be recognized! So, last line should look like
create_makefile( 'api' ).Here is a batch file Extract and Put it into ur project's folder -that will write compiling commands for u. Jst Place it into ur project's folder, change the vcvars32.bat path to your current vcvars32.bat path, and run it to compile.
-
RE: Wrap gem under own namespace
@thomthom said:
Did you try with the one-click installer in the Readme?http://rubyforge.org/frs/download.php/4 ... 27_rc2.exe
Installed it, found and comment out the first 3 lines.
Now, after that I tried it again, everything worked!


Thankyou, Thankyou, thankyou!!!

-
RE: Wrap gem under own namespace
@thomthom said:
Would it not be better to adjust the limit of callbacks in your customized Anton::Win32::API instead of spreading across multiple API modules?
Sure, I'll try to increase callbacks limit in api.c.
Got a little proplem here compiling thomthoms c-extention example:

Some probable cause:- Installed ruby 1.8.6 patchlevel 398.
- Did NOT find these lines in config.h.
#if _MSC_VER == 1200
#error MSC version unmatch
#endif - Have MSFT Visual Studio 10.0
-
RE: Wrap gem under own namespace
@unknownuser said:
- Navigate to the project folder
- Execute "ruby extconf.rb"
- Execute "make"
Need more info on these parts. I opened the Visual Studia 2010 Command Prompt via start menu, but then don't know the EXACT commands to write into the prompt; How do I navigate, and how do I execute, pls. I'm beginner!

-
RE: [Plugin] Ruby Console+ (3.0.2) โ updated 30.10.2017
@jim said:
Start by removing the
ae_Consolefiles and folder from SketchUp's Tools folder, and install the plugin correctly using the Windows > Preferences > Extensions > Install Extension button.Hmm... it still gives me that error!
@aerilius said:
I didn't get that error. I then tested on another computer where I had tested the beta version and got the error.You probably have the beta version installed and the registry (Sketchup 8\Plugins_ae\Console) contains an old/invalid value. The script errors in IE are very pertinacious. I'll try to validate the configuration before passing it into the webdialog.
Errased, the beta, and all version, including this one, ran CCleaner, I guess I got it all removed using regedit, and it still gives me that error. How should error exist, when I cleaned-up after beta?
-
RE: Wrap gem under own namespace
Thanks Dan, now I see that I wasn't the only one confused with these gems compiling thing.
Thomthom, thanks, the example is excelent! And by the way, that idea of Win32::API, under own namespace came from that same TT_Lib2. Don't worry though, I'm not dismantling your TT_LIb to pieces.

To make sure, if I have Anton::Win32::API and Wi32::API, then the Anton::Win32::API::Callbacks.new limit would not count callbacks from standard Win32::API, right? So, If I create to callbaks on Win32::API and 10 on Anton::Win32::API, then it will work?
-
RE: [Plugin] Ruby Console+ (3.0.2) โ updated 30.10.2017
@jim said:
Aerilius,
Nice console, thanks.
Anton,
Why have you by-passed the installer and put the plugin in the Tools folder? The Tools folder is for SketchUp to use and it is recommended not to put anything there.
Start by removing the
ae_Consolefiles and folder from SketchUp's Tools folder, and install the plugin correctly using the Windows > Preferences > Extensions > Install Extension button.LOL, did you monitor my comp??

Exactly, I have it in tools folder. The reason is do to having 3 plugins folders: plugins draw - fredo tools+tt_lib+more, plugins game - sketchy physics, plugins testing - my plugins. I rename one of folders to plugins whenever I feel to use one of them. I jst wanted to eliminate the loading of all "plugins", and use the plugins that I want instead of loading all plugins. For me, the tools folder is like the "main plugins". Ruby console, window settings... is a good place for them - cause I use them in all plugins.Well, anyways thanks for pointing that out: moving it to plugins
-
Wrap gem under own namespace
I don't know if its legal, but how do I set win32-api under my own module namespace (Anton::Win32::API). I have ruby 1.9.3, installed win32-api gem, modified the
ext/win32/api.cto my own namespace, and don't know how to build outapi.sofiles. How do I do it? -
RE: [Plugin] SPGears
+100000000000000000000000000000000000000000000000000000

I couldn't, just couldn't Draw twisted gears myself. No doubt, this is an awesome plug. THanks!!!!

-
RE: [Code] custom file_loaded() and file_loaded?() v2.0.0
@dan rathbun said:
Anton, I set you a personalized copy of v2.0.0 by Private Message.
Lol, I feel speacial now.

-
RE: [Code] custom file_loaded() and file_loaded?() v2.0.0
Here is jst a little mistake in the script:


Inappend_features,mod.namereturns "". Where first interacted mod itself is#<Class:Anton>.Since, I quite don't know what should there be, I can't fix it. So Dan fix it please

-
RE: Identify/locate the Subclass
@dan rathbun said:
obj.respond_to?(:activate)Thanks Dan, description - sure will help.
Edited: Previously, I used
obj.methods.include?(someMethod). - That will give an error if the object wouldn't be a class, nor module. But usingrespond_to?will work on any selected object without errors. JsttrueorfalseI was wrong in blue words. Actually,
.methodscan be implemented in any object.134.methods, nil.methods, "dsfg".methods, false.methods, Class.methodswill always work.

