sketchucation logo sketchucation
    • Login
    1. Home
    2. Alienizer
    3. Posts
    โš ๏ธ Attention | Having issues with Sketchucation Tools 5? Report Here
    A
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 11
    • Posts 120
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Windows themes in Skecthup v8

      @dave r said:

      Oh. The only things you can change are those you can make in the display settings under the Control Panel. You won't be able to change the button appearance though.

      I was afraid you'd say that! I wonder if we can add a manifest file to the .exe?

      posted in SketchUp Discussions
      A
      Alienizer
    • RE: Windows themes in Skecthup v8

      @dave r said:

      What exactly are you trying to do?

      Turn on the Windows themes, so that the interface looks like Windows XP/Vista/7 as oppose to Windows 95!

      I'm running Sketchup v8 on Windows 7 and it looks like Win95 ๐Ÿ˜ฎ

      posted in SketchUp Discussions
      A
      Alienizer
    • Windows themes in Skecthup v8

      Is there a way to turn on Windows themes in Skecthup v8?

      posted in SketchUp Discussions sketchup
      A
      Alienizer
    • RE: Back face/material reverse

      Problem solved.

      After doing more testing, displaying the dot(face.normal, ray) returned <0 and when viewed cam rotated 45deg it was >0

      So after applying a transformation_at the dot() returned the correct cosine. So now my code works perfectly

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @dan rathbun said:

      Many of the ids are already listed in the API doc: Sketchup.send_action()

      Ah!

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @dan rathbun said:

      or ...

      def onMouseMove(flags, x, y, view)
      >   Sketchup.set_status_text("x; #{x} , y; #{y}")
      > end
      

      or...

      def onMouseMove(flags, x, y, view)
        Sketchup.set_status_text("x=%d, y=%d"%[x,y])
      end
      

      @unknownuser said:

      BTW.. on Window... you can use a Coordinate Tool that displays in model units:
      Sketchup.send_action( 21324 )
      the tool_name is "CoordinateTool" but there doesn't seem to be a send_action string for it.

      How did you come up with 21324?

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse
      def onMouseMove(flags, x, y, view)
        Sketchup.set_status_text(x.to_s+" ; "+y.to_s)
      end
      

      Dan, the above code show the mouse coord to be 0,0 at the top-left corner of the viewport, regardless where the window is on the desktop. Any reference to screen coords are within the viewport, not the physical screen. I know about the status text, SK needs to refresh for it to show, and it gets replaces when you move the mouse.

      TIG, my version is 8.0.4011 in the 'About' box.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @dan rathbun said:

      Alan..

      I know what you mean, but I found out in another thread that raytest is FUBAR in SU8, pick is more likely using the same code as raytest.

      That explain why my code works 100% in SU7 but not in SU8

      from thread...
      http://forums.sketchucation.com/viewtopic.php?f=180&t=31326&p=275718&hilit=FUBAR#p275718

      @thomthom said:

      Why do you not want to use an InputPoint? You can use the ip.face to test if you got the point from a face and ignore the rest.

      But, yes, you can shoot a ray:

      ` ray = view.pickray(x, y)
      result = model.ray_test( ray )

      TODO: Recast on hidden entities`

      Then remember that in SU8 the ray_test is FUBAR.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @tig said:

      How is your code finding the mouse position without a tool to monitor the cursor ?

      It's not using the mouse! If you read my code, I have 2 for loops to scan the screen viewport.

      Later I will add mouse support, but my code now is only viewport scanning.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @tig said:

      You need to make it [and launch it] as a Sketchup Tool.

      ?? My code works fine 100% of the time on any models in SU7, it's screwy in SU8. Perhaps it's a bug in SU8, and nothing wrong with my code?

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @tig said:

      What would you like to happen ? In words, not code...

      Back face/material reverse, I know you have a script for that, but I want to make my own where it scans the screen and reverse any faces that are facing back at the camera. Then I want to make it so that if you hover the mouse over your model, it'll do the same, but only on the face your mouse is pointing at.

      The code works, but if I rotate my model 90deg CW, it works half way! Some faces are not reversed, and some that should not, are!

      posted in Developers' Forum
      A
      Alienizer
    • RE: Back face/material reverse

      @dan rathbun said:

      Uh... the UI::Inputpoint class, needs to be used within a Tool class instance.
      The pick method is normally called from within one of the mouse button callbacks of your tool.

      I don't think it makes any difference how it is used. It accept a view and a screen point and has no idea that the point comes from a mouse or any other screen poiting device. The Mouse and InputPoint are not related at all. Otherwise, it would be mouse.get_item_it_points_to or something like that, where you can't change the x and y. It has no idea it's from a mouse event, nor for a tool.

      posted in Developers' Forum
      A
      Alienizer
    • Back face/material reverse

      Either I'm insane or Sketchup is s.up ๐Ÿ‘Š
      I've been trying everything and still it isn't working right. Here is the code...

      def reverseBackFaces
        view = Sketchup.active_model.active_view
        @ip = Sketchup;;InputPoint.new
        eyevec = view.camera.eye.vector_to(view.camera.target)
        i = 0
        y = view.vpheight-1
        unless y < 0
          Sketchup.set_status_text(y.to_s)
          x = view.vpwidth-1
          unless x < 0
            @ip.pick view, x, y
            if @ip.valid? and @ip.face
              if eyevec.dot(@ip.face.normal) >= 0
                @ip.face.material = @ip.face.back_material
                @ip.face.back_material = nil
                @ip.face.reverse!
                i += 1
              end
            end
            x -= 1
          end
          y -= 1
        end
        Sketchup.set_status_text(i.to_s+" faces reversed")
      end
      
      

      It work, then it doesn't, then it does, then it doesn't. What's wrong with my code? I can't find anything wrong ๐Ÿ˜ก

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      It default to the desktop window if a parent is nil. By setting the parent window (SKP), you are sure to get the WM_QUIT message when SKP is closed. hWndParent is optional, but again, the desktop becomes the parent if hWndParent is nil.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      @dan rathbun said:

      @@Alan Are you working on a free or paid plugin?

      Neither! But if I can make something usefull, it will be free. I'm kind of learning right now, until I'm good enough to give something.

      @dan rathbun said:

      Do you want to get the current Ruby (Sketchup) process' application window from the Ruby side, or the C-side ??

      Either way is fine. I only need to know this to set the parent window of my dll forms. So if ruby knows it, I can pass it along to my dll. But if I can get it directly from my dll, that's good too.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      One way that seem to work for me now is...

      Using the code to find the SK window using the pid, get the window text, and if =~ /SketchUp/i then you have the right one, otherwise, set the window handle to nil and when your ruby code gets called for whatever reason, test if the window handle is nil, and it it is, re-get it again, then continue execution.

      So far, this way has worked for me all night, running 3-5 instances of SKP, and running them using direct, shortcuts, skp docs, via an exe and all. It worked even when other ruby script has errors.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      @dan rathbun said:

      While Sketchup starts up, and is processing the rubies in the Plugins and Tools folders, the UI is not yet finalized. The menus and toolbars are not built until all rubies that modify or create toolbars have been processed.

      Is there a way to "wait" until SK is loaded? I'm not using the title bar caption to find the window, I'm using Process.pid and iterate all windows to match the pid.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      @dan rathbun said:

      There are some quirks with some of the version system calls... look thru the source code for Daniel Berger's win32-api package.

      Link Preview Image
      GitHub - cosmo0920/win32-api: A different, better variant of the Win32API Ruby library

      A different, better variant of the Win32API Ruby library - cosmo0920/win32-api

      favicon

      GitHub (github.com)

      and

      https://github.com/djberg96/windows-pr
      Some system calls were added for ver 6+ (dealing with the registry,) and some are not supposed to used with ver 6+.
      You can look at the issues, and you'll see a list of registry system calls that I help him out with, that he added to the package. (In case you don't want to d/l the source.)

      ADD: Here's the issues link if interested:
      https://github.com/djberg96/windows-pr/issues?direction=desc&sort=created&state=closed

      Thanks! I'll have a look.

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      @unknownuser said:

      Does it mean there is a Win32api.so working for both Win32 and Win64 (Vista and 7)?

      Apparently not, it's all 32bit only but Win32api.so works just fine in Win7/64 and Vista/64, so as in XP/64

      posted in Developers' Forum
      A
      Alienizer
    • RE: Window handle from process

      @dan rathbun said:

      you can read the interpreter's source to get an idea of what's happening behind the scenes.

      yeah! I've done that once with the RH Linux source. It's difficult when you're not the one who wrote it. It's easier to ask ๐Ÿ˜‰

      Going back to this SKP window handle thing, sometime it doesn't work when I double click on an SKP file. But it always work using the shortcut! I don't have wxSU installed. What do you think it could be?

      posted in Developers' Forum
      A
      Alienizer
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 1 / 6