sketchucation logo sketchucation
    • Login
    1. Home
    2. lothcat
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    L
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 25
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Adding attributes help

      Now it's getting even weirder...

      I changed the lines to read:

      value = face.set_attribute ("agw_attributes", "location", agw_location)

      Because that's the way it always is in the examples, and I thought maybe it needs to be set as a variable to be applied. It doesn't make sense to me, but hey, I've seen programming languages insist on weirder things. So I added this code snippet:

      if (value)
      UI.messagebox value
      end

      And, weirdly enough, that works exactly like it's supposed to.

      Maybe it's a problem with the way I'm checking to see if the attributes are being applied? I'm making my test wall, turning it into a group, and then reading my attributes with the attribute reporter script from here: http://code.google.com/apis/sketchup/docs/tutorial_attrreporting.html.

      I'm suspecting that it isn't reporting the attributes in my custom dictionaries. Have I been banging my head against the wall trying to fix a problem I'm not having?

      If so, how could I fix the code to show my custom dictionaries?

      Thank you all so much! This is not only my first Sketchup project, but also my first time using Ruby, so I really need the help.

      posted in Developers' Forum
      L
      lothcat
    • RE: Adding attributes help

      I'm not making it a material because I'm using it to model a house. Well, a wall, specifically. But a house in the real world. Once the person is done adding all the attributes and finishes their house, I'm going to have the program print out the attributes.

      This is actually just one part of a larger construction program. The larger program will use the printed out attributes, but each wall (and floor, and ceiling, etc.) will need to be able to store them as part of the larger model.

      I've modified them to this:

      	 face.set_attribute ("agw_attributes", "exterior_color", agw_exterior_color)
      	 face.set_attribute ("agw_attributes", "construction_type", agw_construction_type)
      	 face.set_attribute ("agw_attributes", "location", agw_location)
      

      but it's still not working.

      posted in Developers' Forum
      L
      lothcat
    • RE: Adding attributes help

      It's a String. That isn't the problem. I thought maybe I have the syntax wrong?

      posted in Developers' Forum
      L
      lothcat
    • RE: Adding attributes help

      agw_exterior_color is a string - I'm only trying to add variables that are Strings or Floats. Actually, they could all be Strings, I just need to save the information in the model.

      posted in Developers' Forum
      L
      lothcat
    • Adding attributes help

      I'm having a hard time figuring out how to add attributes to an entity. Basically, I have this code that creates a face, applies a material, and then applies attributes - but the attributes aren't being applied. The Google Ruby API is no help.

      I'm sure I'm just doing it wrong, but I haven't figured out what exactly I'm doing wrong yet. The Google Ruby API is no help.

      Here's my code snippet:

      face = entities.add_face pts
      face.material = agw_mat
      face.back_material = agw_mat #Everything up to here works
      UI.messagebox "Applied the Material" # debugging UI prompt

      face.set_attribute "agw_attributes", "exterior_color", agw_exterior_color #This, as far as I can tell, does diddly.

      posted in Developers' Forum
      L
      lothcat
    • 1 / 1