sketchucation logo sketchucation
    • Login
    1. Home
    2. Anton_S
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    โš ๏ธ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    A
    Offline
    • Profile
    • Following 0
    • Followers 7
    • Topics 52
    • Posts 1,261
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Notepad++ SU8 Ruby API Autocomplete

      Notepad++ and Sublime 2 are awesome, but there is no editors similar to RubyMine; Using it forever!

      posted in Developers' Forum
      A
      Anton_S
    • 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
      end
      

      Copy to nowpad++ to unwrap all lines
      Note its no more self.currentPos, its just currentPos

      posted in Developers' Forum
      A
      Anton_S
    • 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 testing

      Menu 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.


      Save to Plugins directory

      posted in Developers' Forum
      A
      Anton_S
    • 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
      end
      

      Copy to editor to unwrap the code lines.
      It basically shows how that transform formula works
      By the way If you have sketchy physics, you can see play with something similiar here: Navigation System

      posted in Developers' Forum
      A
      Anton_S
    • Calculate edge &quot;profiles&quot;?

      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:
      ![Dark lines are edge "profiles"](/uploads/imported_attachments/7I2e_Untitled.png "Dark lines are edge "profiles"")
      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. ๐Ÿ˜•

      posted in Developers' Forum
      A
      Anton_S
    • RE: [Plugin] Ruby Console+ (3.0.2) โ€“ updated 30.10.2017

      @aerilius said:

      I uploaded...

      Good, good!! Thks ๐Ÿ˜„

      posted in Plugins
      A
      Anton_S
    • RE: [Plugin] Ruby Console+ (3.0.2) โ€“ updated 30.10.2017

      @aerilius said:

      ...upload it soon

      That'll be great โ—

      posted in Plugins
      A
      Anton_S
    • 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.

      posted in Developers' Forum
      A
      Anton_S
    • 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! โ˜€
      It works!!!
      Thankyou, Thankyou, thankyou!!! ๐Ÿ˜„ ๐Ÿ‘ ๐Ÿ‘

      posted in Developers' Forum
      A
      Anton_S
    • 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 strange error
      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
      posted in Developers' Forum
      A
      Anton_S
    • RE: Wrap gem under own namespace

      @unknownuser said:

      1. Navigate to the project folder
      2. Execute "ruby extconf.rb"
      3. 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! ๐Ÿ˜ณ

      posted in Developers' Forum
      A
      Anton_S
    • RE: [Plugin] Ruby Console+ (3.0.2) โ€“ updated 30.10.2017

      @jim said:

      Start by removing the ae_Console files 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?

      posted in Plugins
      A
      Anton_S
    • 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?

      posted in Developers' Forum
      A
      Anton_S
    • 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_Console files 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

      posted in Plugins
      A
      Anton_S
    • RE: [Plugin] Ruby Console+ (3.0.2) โ€“ updated 30.10.2017

      Another Error
      Untitled.png

      posted in Plugins
      A
      Anton_S
    • 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.c to my own namespace, and don't know how to build out api.so files. How do I do it?

      posted in Developers' Forum
      A
      Anton_S
    • RE: [Plugin] SPGears

      +100000000000000000000000000000000000000000000000000000
      ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ˜„ ๐Ÿ˜„
      I couldn't, just couldn't Draw twisted gears myself. No doubt, this is an awesome plug. THanks!!!!
      Untitled.png

      posted in Plugins
      A
      Anton_S
    • 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.

      ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

      posted in Developers' Forum
      A
      Anton_S
    • RE: [Code] custom file_loaded() and file_loaded?() v2.0.0

      Here is jst a little mistake in the script:
      error.png
      script.png
      In append_features, mod.name returns "". 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 ๐Ÿ˜„

      posted in Developers' Forum
      A
      Anton_S
    • 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 using respond_to? will work on any selected object without errors. Jst true or false

      I was wrong in blue words. Actually, .methods can be implemented in any object. 134.methods, nil.methods, "dsfg".methods, false.methods, Class.methods will always work.

      posted in Developers' Forum
      A
      Anton_S
    • 1 / 1