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

    Webdialog component and group html attributes

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 358 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.
    • 4 Offline
      4dHans
      last edited by 4dHans

      I am trying to make a webdialog that updates with the selection, just like component options does, and sets the content of the attribute: ("dialog_product","html_code","#{value}").
      So basicly, the dialog will be like a webpage for the component, the html is the value

      Dictionary;dialog_product
      Name;html_code
      Value;<html><body><a href=""><i>BUY HERE!!! 0.5mm x 0.37mm</i></a></body></html>
      

      ,the dialog, that updates with the selection, will do that value. Could someone help me?

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        Normally, you would wish to use an Observer to "make changes happen" in your webdialog.. however the SelectionObserver is still bugged.

        see: http://www.thomthom.net/software/sketchup/observers/

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • Dan RathbunD Offline
          Dan Rathbun
          last edited by

          You may try using the onSelectionBulkChange callback of a SelectionObserver custom subclasss, to trigger your changes. Then use the query methods of the Selection collection class (http://code.google.com/apis/sketchup/docs/ourdoc/selection.html) to determine if the selection is a single object (method single_object?), and if so test if it is an instance of Sketchup::ComponentInstance, and if it is.. whether it has an attribute dictionary of a certain name, and if so, make your changes.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @dan rathbun said:

            Then use the query methods of the Selection collection class (http://code.google.com/apis/sketchup/docs/ourdoc/selection.html) to determine if the selection is a single object (method single_object?)

            Note that single_object? will return true if you have a surface selected- which is multiple faces. To check if the selection really contains only one entity use the length property.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • 4 Offline
              4dHans
              last edited by

              Thanks, guys. I Hope I can get this to work. ❓

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

              Advertisement