• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

[Plugin] AMS Library 3.7.1b (29 May 2021)

Scheduled Pinned Locked Moved Plugins
107 Posts 38 Posters 614.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    wikii
    last edited by 22 Nov 2015, 06:49

    Hi Anton_S

    Thank you for you reply!

    If I want send a message from Sketchup window A to Sketchup window B, I can use AMS::Window.send_message.

    But ,how can Sketchup window B get to know there is a message come from window A?

    I think , Window B must have an observer to get message when message come.

    I want to konw , can window B respond message sent from A immediately?

    Thank you for you great lib!

    wikii

    1 Reply Last reply Reply Quote 0
    • A Offline
      Anton_S
      last edited by 22 Nov 2015, 09:20

      Hmm, communication between windows? That's interesting! I will look into that.

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 22 Nov 2015, 22:14

        Maybe this?

        https://msdn.microsoft.com/en-us/library/windows/desktop/ms644951%28v=vs.85%29.aspx

        Hi

        1 Reply Last reply Reply Quote 0
        • A Offline
          Anton_S
          last edited by 22 Nov 2015, 23:39

          Thanks for the head start, Jim! That, SendMessageCallback, should do it. I will implement it into my library for an easy way to use. This is what I'm thinking to add in the future release:

          A function to communicate to another window.
          ` # Transmit information to another window.

          @param [Fixnum] dest_handle A handle to a destination window.

          @param [Fixnum] id A unique message identifier, a value b/w 0 and 4016.

          ID allows users to filter their messages from messages of other users.

          However, there is a downside, as some plugin developers might use

          same ID, but it's very unlikely.

          @param [String] data Message information.

          AMS::Sketchup.send_message_to_window(dest_handle, id, data)`

          An observer that receives transmitted messages.
          ` # Called when user sent message arrives to its destination window.

          @param [Fixnum] sender_handle A handle to a window that sent a message.

          @param [Fixnum] id Message id.

          @param [Fixnum] data Message information.

          AMS::SketchupObsever.swo_on_message_received(sender_handle, id, data)`

          A bonus function that allows users to get handles to all Sketchup Windows.
          ` # Get all SU windows

          @return [Array<Fixnum>] An array of all SketchUp main windows except this one.

          AMS.get_all_sketchup_windows`

          An example, where this window communicates to all other SU windows:

          class MyDataTransferClass
          
            MY_PORT = 123
          
            # @param [String] Data in string form.
            def send_data_to_all_windows(data)
              su_windows = AMS.get_all_sketchup_windows
              su_windows.each { |dest_handle|
                AMS;;Sketchup.send_message_to_window(dest_handle, MY_PORT, data)
              }
            end
          
            # Implement one of the SketchUp Window Observer callback methods.
            def swo_on_message_received(sender_handle, id, data)
              # Return if id is not yours
              if id != MY_PORT
              # Otherwise, do anything with data.
              # In our case, we'll evaluate it.
              eval(data)
            end
          
          end # class MyDataTransferClass
          
          # Create an instance of our communication class
          my_data_transfer = MyDataTransferClass.new
          
          # Register your class to SketchUp observers as it contains one of the SU observer methods.
          AMS;;Sketchup.add_observer(my_data_transfer)
          
          # Send a message to all other SU windows.
          my_data_transfer.send_data_to_all_windows("puts 'Hi, this is a message from another window!'")
          

          Well, you have an insigt of how I'm planning to implement it. Once I'll add these functions into my library, I will notify you, wikii.

          If anyone has any suggestions on improvement of this plan, please inform.

          1 Reply Last reply Reply Quote 0
          • P Offline
            Pherim
            last edited by 23 Nov 2015, 14:19

            @anton_s said:

            Hello Pherim. I tried to reproduce the crash or inconsistent cursor changing behavior with AMS Library 3.0.1, but, similarly to your trial, I couldn't. It is very likely that such bug persisted in version 3.0.0, but not in the current version, 3.0.1. But to be sure, I'll keep an eye on the library.

            Hello,

            it happened again, now in Sketchup2016, with basically nothing but your plugins installed via Sketchucation tools. I don't know what exactly causes it, but it never happened with AMS Library and Window Settings disabled. I hope you can find the issue and fix it, as I would really like to be able to toggle toolbars and toolbar containers with hotkeys. With SU2016, the new trays which replace the dialog windows can natively be toggled with hotkeys, which is a very good addition in my opinion.

            1 Reply Last reply Reply Quote 0
            • A Offline
              Anton_S
              last edited by 23 Nov 2015, 22:30

              Thanks for your another report Pherim. I'm trying my best to reproduce that crash. In order to track it down, a little more information that lead to a crash would be appreciated.

              1. Did the crash occurred following a certain operation, like triggering a particular button, shortcut, or command or did the crash occur randomly?
              2. At what time did SU crash, when SU launched or some after it after is launched?
              3. Was the Window Settings dialog open at the time of the crash?
              1 Reply Last reply Reply Quote 0
              • P Offline
                Pherim
                last edited by 24 Nov 2015, 11:41

                Alright, here's what I got so far:

                When I start Sketchup with AMS Lib and Window Settings active, at first everything works fine. As I begin playing around with different tools, both native SU and from extensions, after a short time, tools begin to stay highlighted in the toolbar (only native SU toolbars in SU 2016, as tools in other toolbar are not highlighted at all in this version) even after changing to another tool, and then shortly after SU will crash when right-clicking, mostly on a group or component, I believe, and possibly only with a non-native tool active.

                It does not happen with just AMS Lib active and Window Settings disabled in Sketchucation Plugins/Extensions Manager, but as no other plugin depends on it, I guess it could be the cause, as well.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Anton_S
                  last edited by 27 Nov 2015, 06:51

                  Hello Wikii, I have added a feature to communicate between windows on same computer. See http://www.rubydoc.info/github/AntonSynytsia/AMS-Library/master/AMS/Sketchup#send_user_message-class_method

                  Pherim, I tried reproducing that crash and I came across it once, but, following similar operations, I couldn't reproduce it again. It seems to occur very rarely. I haven't been able to track the crash down, but I did make small changes and improvements, which could potentially resolve the crash.

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Pherim
                    last edited by 27 Nov 2015, 07:04

                    I'm afraid it still happens... I was just able to reproduce it two times, using only standard tools.

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Anton_S
                      last edited by 27 Nov 2015, 07:14

                      Good! Looks like you know the exact steps to reproduce it. List 'em here, please.

                      1 Reply Last reply Reply Quote 0
                      • P Offline
                        Pherim
                        last edited by 27 Nov 2015, 07:48

                        Well there is not much more to it than I already wrote. I just use various tools, make groups and components and edit them, until the tools begin to stay highlighted in the toolbar - this happens all the time. Then, at some point, it eventually crashes when I right-click, possibly only or at least more often on groups or components. I tried to record a video of the process, but so far, I have not been able to produce a crash while recording. Maybe they are not happening as often now, but they definitely still do.

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Anton_S
                          last edited by 29 Nov 2015, 18:13

                          Hello everyone, AMS Library version 3.1.1 has been released. It is important to upgrade to a new version because it addresses a bug fix, which caused spike in performance, which lead to toolbar icons staying highlighted and eventually to a crash. Huge thanks to Pherim for reporting and verifying it. See first post for download links.

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            Pherim
                            last edited by 30 Nov 2015, 11:07

                            Thanks again for fixing it!

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              junaramaro
                              last edited by 3 Dec 2015, 07:55

                              i think it no longer has a support for xp...it shows some error 😐 ...sorry i forgot to post some pics...but it really does.i hope some xp users show the error..but i'll post it soon...or maybe its a bug...please dont stop the support for xp unlike microsoft...this is a really great plugin with lots of possibilities.... 😉

                              1 Reply Last reply Reply Quote 0
                              • A Offline
                                Anton_S
                                last edited by 3 Dec 2015, 17:53

                                Opps I forgot to test it on Win XP. Ill check it out.

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  Anton_S
                                  last edited by 5 Dec 2015, 00:54

                                  Hello, junaramaro, I made it compatible with Windows XP. Thanks for reporting.

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    junaramaro
                                    last edited by 5 Dec 2015, 08:08

                                    Thank you so much sir... 😄 ...i'm updating now. i really love being in this community of loving and thoughtful persons...
                                    thank you again master ...may the force be with you... 😆

                                    i really think you have to be a jedi to come up with this wonderful things...

                                    1 Reply Last reply Reply Quote 0
                                    • P Offline
                                      perroloco2000
                                      last edited by 12 Feb 2016, 00:28

                                      Hello
                                      Everytime I try to hide menu bar with AMS Window Settings crash my SU 2016. I´m using AMS Window Settings 4.2.0 and AMS Library 3.1.4
                                      Please help, is really useful optimize my screen when I work on the laptop
                                      Thanks for your greats plugins

                                      1 Reply Last reply Reply Quote 0
                                      • A Offline
                                        Anton_S
                                        last edited by 13 Feb 2016, 20:27

                                        Can you downgrade to 3.1.3 and check if the crash still occurs? Here is the download link to 3.1.3: https://drive.google.com/open?id=0B3qg8f4WrNdHci1DLTZEbVpqdzQ

                                        1 Reply Last reply Reply Quote 0
                                        • P Offline
                                          perroloco2000
                                          last edited by 14 Feb 2016, 23:20

                                          I had 3.1.3 before, actually I did upgrade to 3.1.4 trying to fix this
                                          Thanks

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 6
                                          • 2 / 6
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement