sketchucation logo sketchucation
    • Login
    1. Home
    2. michaelwhksg
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 20
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Dynamic Component DCFunctionsV1 within in Module

      A proposed layout for a new site that shows the pallet racking, with a dedicated mezzanine on the left and conveyor system for segregating the inventory via dispatch routes.

      Link Preview Image
      WarehouseBlueprint - Warehouse Layout Design Software

      Model engaging 3D warehouse in 15 minutes. Build up warehouse layout design with software. Create visual presentation. WarehouseBlueprint.

      favicon

      WarehouseBlueprint (warehouseblueprint.com)


      Warehouse Layout


      Warehouse Layout - Rendered

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Extension Licensing System

      Thanks a lot, Rich. Will send a PM to him.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Extension Licensing System

      Have anyone use rubyencoder before?

      Link Preview Image
      Ruby Encoder. Protect your Ruby and Rails code

      The RubyEncoder protects Ruby scripts by compiling Ruby source code into a bytecode format and this is followed by encryption.

      favicon

      (www.rubyencoder.com)

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • Extension Licensing System

      Hi, I have tried to search the forum to understand more on the licensing system for an extension I have created.

      Managed to find something for SketchUp Extension Warehouse licensing.

      Aside from that, can anyone advise if I want to have an external licensing system, where can I find more information?

      Thanks.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Will look into the licensing aspect in the forum, Dan.

      Yes, you are right. I have used a unique function name for my extension. atan2 is just an example.

      By the way, I have sort of documented the steps I took to create the DC extension and have it published in the Extension Warehouse.

      Just to share with anyone who is interested. It is actually for my own reference in future.


      Creation of extension and submission to Extension Warehouse

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi TIG and Dan, good news. My extension is being approved by the EWH team and the trial version is now in the Extension Store.

      Link Preview Image
      SketchUp Extension Warehouse

      Your library of custom third-party extensions created to optimize your SketchUp workflow.

      favicon

      (extensions.sketchup.com)

      Like you mentioned previously, the EWH team initially rejected the idea of having the DCFunctionsV1 approach. After I explained the rationale of using it, they finally gave the approval.

      Seems like there's light at the end of the tunnel.

      Thanks.

      My next challenge will be the licensing issue.

      I went thru Julia Christina Eneroth's tutorial, but still have some questions. For example, in the code, ext_id = "15dfa30f-4957-4549-8cdb-e97b5727a13a", I am unsure how this comes about.

      Anyway, one way I circumvent this is to have the trial version in the Extension Store and the full version in my website (still fixing up the shopping cart in my website though).

      Thank for the guidance. You guys rock!

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Oh I see. Thanks a lot Dan. Will wait for the feedback from them then.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi, does anyone know how long it takes to get an extension approved by the Extension Warehouse Team normally?

      After a few rounds of back and forth and updating the extension, I submitted the extension again on 29May. Aside from getting the one auto-response, I did not hear anything else.

      I then resubmitted again on 13June. Still no change in the status.

      Any advice on this?

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Just an update to everyone.

      After a few rounds of re-submission of my extension to meet the stringent requirements, this time, it is taking slightly longer than usual. I am still waiting for the status of being published in the Extended Warehouse.

      In any case, below are some of the screenshots I have created for the extension.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Thanks, Dan. Will take a look at Julia's tutorial.

      I do agree that some improvements can be made to the DC functionalities. This will definitely benefit a lot of users.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi TIG, Dan,
      Is there any resources online that shows how we can input the licensing code to our script? The below web link automatically directed me to another webpage instead of the licensing tutorial.

      http://www.sketchup.com/intl/en/developer/docs/tutorial_licensing

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi Dan,
      Thanks for the feedback.

      1. Have already edited the previous posts with the code tags.
      2. Have changed the example slightly (removal of the name atan2).
      3. Will use my unique name for the formula in the DCFunctionsV1 class.

      Will try to submit the extension after I clean up my code.
      Thanks.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Since we are unable to wrap the class DCFunctionsV1 in the name space, if we just submit the script with 2 parts, one of which is the DCFunctionsV1 and letting the formula be defined as my own unique name, and the second part which is wrapped within my name space, will this work? Will EWH team accept this?

      For example,...

      # add_funcs.rb
      # extends DCs functions
      require('sketchup')
      if Sketchup.version.to_i <= 8
        require('dynamiccomponents.rb')
      else
        require('su_dynamiccomponents.rb')
      end
      if defined?($dc_observers)
        # Open SketchUp's Dynamic Component Functions (V1) class.
        # only if DC extension is active
        class DCFunctionsV1
          protected
          unless DCFunctionsV1.method_defined?(;XXXXXX)
            # access to Ruby's arctangent method
            # Usage; =ABC123
            def (we give this definition a unique name)
              return XXXXXX (my own unique formula)
            end
          end#unless
          protected;ABC123
        end#class
      end#if
      
      module ABC
      module ABC123
      
      codes to be in the name space
      
      end #ABC123
      end #ABC
      
      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      If i am using the code which you have shared, and keying DCFunctionsV1.instance_methods.sort in the Ruby Console, I do see atan2 appearing in the console.

      However, if I tried inserting the DCFunctionsV1.instance_methods.sort into the code, an error message appeared.

      Below is the code which I have tried...


      # add_funcs.rb
      # extends DCs functions
      require('sketchup')
      
      module ABC
      module ABC123
      
      if Sketchup.version.to_i <= 8
        require('dynamiccomponents.rb')
      else
        require('su_dynamiccomponents.rb')
      end
      if defined?($dc_observers)
        # Open SketchUp's Dynamic Component Functions (V1) class.
        # only if DC extension is active
        class DCFunctionsV1.instance_methods.sort #(did I do this correctly?)
          protected
          unless DCFunctionsV1.method_defined?(;atan2)
            # access to Ruby's arctangent method
            # Usage; =atan2(y,x)
            def atan2(a)
              return Math;;atan2(a[0],a[1]).radians
            end
          end#unless
          protected;atan2
        end#class
      end#if
      
      end #module ABC123
      end #module ABC
      
      

      This generated an error message.

      "Error Loading File arctan-test2.rb
      Error: #<SyntaxError: C:/Users/wongh/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Plugins/arctan-test2.rb:16: syntax error, unexpected '\n', expecting :: or '[' or '.'
      C:/Users/wongh/AppData/Roaming/SketchUp/SketchUp 2017/SketchUp/Plugins/arctan-test2.rb:30: syntax error, unexpected keyword_end, expecting end-of-input
      end #module ABC
      ^>"

      Is there anything I have done wrongly?


      arctan-test2.rb


      arctan-test.skp

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi TIG. Sorry, will use the "code" tags in future.

      Will try to submit once I have cleaned up the code.
      Fingers crossed, but I have a feeling that you are right. It might get rejected.

      It will be a pity though, because I believe there are many members who are able to build up the dynamic components (which can speed up and simplify the entire modelling process), but there's no way to prevent the DC from being distributed without the authors' agreement.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Thanks for the advice, TIG. Appreciate your input.

      At this moment, I am using the code for myself. However, I am also looking at opportunity to release the dynamic components I have created into the Extension Store.

      I have seen the recommendation that you have shared with others in the forum. One way of getting the DC component to be dependent on the plugin is to give the DC component a function defined in the code. The DC component will not work without the plugin.

      How can we use the class DCFunctionV1 within the name space (our own module) so that it fulfills the requirement of a good practice of a plugin? This is the question I am trying to get around. Any recommendation on this?

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Understood your message, TIG.

      Does this mean that at this point in time, we are unable to introduce a new function in our name spaces?

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Hi TIG, I have been trying for a few days with DCFunctionsV1.instance_methods.sort.

      However, it does not really work.

      Are you able to help enlighten me further?

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • RE: Dynamic Component DCFunctionsV1 within in Module

      Thanks a lot for the advice, slbaumgartner and TIG. 😄 Will try the codes later.

      Another question, if you don't mind. Assuming we do not confine the entire code within it's own namespace (module), will there be a chance that name of the customised formula clashes with someone's else?

      If we have created another unique formula for the dynamic component, for example, def qwer(a) and qwer(a)=a[0]+a[1]+a[2]. Is there any way from preventing others from using the same name as qwer(a)?

      Thanks.

      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • Dynamic Component DCFunctionsV1 within in Module

      Hi I am a newbie to ruby. Can we place the DCFunctionsV1 within Module?
      I am unable to get the customized formula in the dynamic component.
      Please kindly advise.
      Thanks.


      # add_funcs.rb
      
      require 'sketchup'
      
      module M123
      module M123abc
      
      # Open SketchUp's Dynamic Component Functions (V1) class.
      
      class M123;;M123abc;;DCFunctionsV1
        protected
      
        # provide access to Ruby's arctangent method
        #
        # Usage;  atan2(y,x)
      
        def atan2(a)
          return Math;;atan2(a[0].to_f, a[1].to_f).radians
        end
      
      end
      end
      end
      
      posted in Developers' Forum
      michaelwhksgM
      michaelwhksg
    • 1 / 1