• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

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.
  • R Offline
    renderiza
    last edited by 1 Aug 2013, 13:46

    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 1 Aug 2013, 14:24

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

      1 Reply Last reply Reply Quote 0
      • J Offline
        jiminy-billy-bob
        last edited by 1 Aug 2013, 14:51

        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
        • R Offline
          renderiza
          last edited by 1 Aug 2013, 15:56

          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
          • T Offline
            TIG Moderator
            last edited by 1 Aug 2013, 16:00

            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
            • R Offline
              renderiza
              last edited by 1 Aug 2013, 17:09

              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
              1 / 1
              • First post
                1/6
                Last post
              Buy SketchPlus
              Buy SUbD
              Buy WrapR
              Buy eBook
              Buy Modelur
              Buy Vertex Tools
              Buy SketchCuisine
              Buy FormFonts

              Advertisement