• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Webdialog component and group html attributes

Scheduled Pinned Locked Moved Developers' Forum
5 Posts 3 Posters 359 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 27 Sept 2010, 23:52

    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
    • D Offline
      Dan Rathbun
      last edited by 30 Sept 2010, 09:40

      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
      • D Offline
        Dan Rathbun
        last edited by 30 Sept 2010, 09:51

        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
        • T Offline
          thomthom
          last edited by 30 Sept 2010, 10:34

          @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 4 Oct 2010, 23:14

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

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

            Advertisement