Need help creating a login plugin for sketchup

I have 1 dynamic components library. I want to create a plugin to share it with users. If they want to use it then they need to sign in. I want to do this to know that they are not stealing it. I am From Viet NAm

So do you have any programming experience ?
If so what coding languages ?

1 Like

I know c++

To start

You will need to use a SketchupExtension registrar script and follow the Technical Details section for packaging a SketchUp extension …

I posted an example extension registrar script here …

And sign your extension …


You will also need to download the SketchUp C SDK.

The SDK includes the docs, but they are also online here:


These repositories can help show how a C/C++ extension can be written for SketchUp …

The Ruby interpretive programming language is implemented in C, so you can call Core Ruby and SketchUp Ruby API methods from C.

You could use the SketchUp API’s Sketchup::Http::Request class which is asynchronous or the Ruby Standard Library’s Net::HTTP class which is synchronous.

For the sign-in window you could use a simple UI.inputbox or a more complex UI::HtmlDialog. (The HTML dialog requires knowledge of HTML, CSS, JavaScript and Ruby.)

The UI.inputbox is rather simple …

module DongUniqueNamespace     # <<--- <<< change
  module PluginNeedingSignIn   # <<--- <<< change

    extend self

    def get_credentials
      prompts = ["Username", "Password"]
      defaults = ["", ""]
      result = UI.inputbox(prompts, defaults, "Sign In")
      result ? result[0], result[1] : "", ""
    end

    def sign_in
      return if @signed_in
      username, password = get_credentials()
      # send the credentials to your server, and set the @signed_in variable.
    end

    if !defined?(@loaded) # run once at startup block:
      UI.menu("Plugins").add_item("Dong Sign In") { sign_in() }
      @loaded = true
      @signed_in = false
    end

  end
end

(…scroll to see all code…)

can you send me a link to refer to the steps to create a plugin with the code you sent me.
Tks Sir
[image]

Here is the link to the above post …

Other than this, I do not know what you are asking for.

I will not write the whole plugin for you. Do some research using the links provided in the above post.