sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Change default material

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 2 Posters 672 Views 2 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.
    • BurkhardB Offline
      Burkhard
      last edited by

      It is possible to change the default material of the box within this script to opacity 30% automaticly?
      ...and set the value for the z-axis to -10cm

      Burkhard


      box_pos.rb

      [http://www.ia-plus.de(http://www.ia-plus.de)]

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

        @burkhard said:

        It is possible to change the default material of the box within this script to opacity 30% automatically?
        ...and set the value for the z-axis to -10cm

        Burkhard

        values = [100.cm, 100.cm, 100.cm, 0.cm, 0.cm, -10.cm]
        
        new_material=model.materials.add("Burkhard_Material")
        new_material.color=[128,128,128] ### a mid-grey, adjust to suit...
        new_material.alpha=0.5 ### 0.5=50%, 1=opaque
        entities.each{|e|e.material=new_material if e.typename=="Face"}
        

        TIG

        1 Reply Last reply Reply Quote 0
        • BurkhardB Offline
          Burkhard
          last edited by

          Thanks TIG,

          but there's no change in the prompt box. I'll set the value to -10
          and the box dimensions to 3oo. The prompt window shows default settings : 100 and 0.

          ... and where do I have to copy these new material files. My tries show no results.

          thanks again Burkhard

          [http://www.ia-plus.de(http://www.ia-plus.de)]

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

            @burkhard said:

            Thanks TIG,

            but there's no change in the prompt box. I'll set the value to -10
            and the box dimensions to 3oo. The prompt window shows default settings : 100 and 0.

            ... and where do I have to copy these new material files. My tries show no results.

            thanks again Burkhard

            Here's a 'tweaked' version of the script. Read the ### parts to see what I've done. I added the material part in near the end after the faces are made, AND made the 'def' within a 'Box' class and then split the dialog variables as @xxx so they are defaulted at the first go but they are then remembered as last set during that session.


            box_pos[1].rb

            TIG

            1 Reply Last reply Reply Quote 0
            • BurkhardB Offline
              Burkhard
              last edited by

              Works well here.

              Thanks a lot TIG. These credits are yours 😉

              Burkhard

              [http://www.ia-plus.de(http://www.ia-plus.de)]

              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