sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Set layer color with code possible?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 162 Views 4 Watching
    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.
    • renderizaR Offline
      renderiza
      last edited by

      Hi, I want to be able to set the layer color with code but not sure if its even possible. Is there any way I can achieve this?

      Thanks!

      [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

      1 Reply Last reply Reply Quote 0
      • T Offline
        th3lurker
        last edited by

        Not possible as far i remember, i had the same question. But maybe things have changed.

        1 Reply Last reply Reply Quote 0
        • jiminy-billy-bobJ Offline
          jiminy-billy-bob
          last edited by

          Tig wrote a snipper for this : http://sketchucation.com/forums/viewtopic.php?t=21090
          But it only sets a RGB color. No material, no reading the color.

          It seems adam found a way to do it with the SDK : http://sketchucation.com/forums/viewtopic.php?f=180&t=25697
          Although he always forget to upload it ^^

          25% off Skatter for SketchUcation Premium Members

          1 Reply Last reply Reply Quote 0
          • renderizaR Offline
            renderiza
            last edited by

            Thank you I will be checking them out!

            [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Right now it's pretty messy... πŸ˜’

              There is nothing in the API.

              AdamB did say he found a way to do it using some C trickery, but it's never been made public.

              The way my cludge works is to export the layer in a DXF then rewrite its RGB values, then re-import it, overwriting the previous layer name and moving all entities to the new 'renamed' layer...
              This is frankly a poor do!

              Some of my tools that export DXF files [Slice(Pro)] do remap the layer colors to match some 'standards'...
              Since a DXF file is in plain-text it is easy enough to stream-edit that and adjust the colors RGB values after the export is completed...

              TIG

              1 Reply Last reply Reply Quote 0
              • renderizaR Offline
                renderiza
                last edited by

                Hopefully next API update includes this function...Thanks TIG!

                [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

                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