Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:53:07+00:00 2026-05-27T15:53:07+00:00

I have created an Dynamic Component which depend of its options. I just need

  • 0

I have created an Dynamic Component which depend of its options.
I just need to change this options programmatically from ruby api. But I can’t understand how to do it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:53:08+00:00Added an answer on May 27, 2026 at 3:53 pm

    From the Google Engineer who created Dynamic Components for SketchUp and posted this code on the SketchUcation Forum:

    UI.menu("Plugins").add_item('Make Sang Red') {
    
    # Assumes that sang is the 1st entity in model.
    sang = Sketchup.active_model.entities[0]
    sang_def = sang.definition
    
    # Override sang's shirt color to red. ("material"
    # is a special attribute that requires
    # you to set a formula to "take control" 
    # over the default material the user has painted.)
    sang_def.set_attribute 'dynamic_attributes', 'material', 'red'
    sang_def.set_attribute 'dynamic_attributes', '_material_formula', '"red"'
    
    # Add a new configurable option to Sang.
    # (Any attribute that starts with an underscore
    # is a "meta attribute" that describes behavior.)
    sang_def.set_attribute 'dynamic_attributes', 'weight', '145'
    sang_def.set_attribute 'dynamic_attributes', '_weight_label', 'weight'
    sang_def.set_attribute 'dynamic_attributes', '_weight_formlabel', 'My Weight'
    sang_def.set_attribute 'dynamic_attributes', '_weight_units', 'STRING'
    sang_def.set_attribute 'dynamic_attributes', '_weight_access', 'TEXTBOX'
    
    # Change the description that shows
    # up in the configure box with a custom
    # formula.
    sang_def.set_attribute 'dynamic_attributes', '_description_formula', '"Sang is now red and weighs " & weight'
    
    # There is a global handle into the plugin that
    # allows you to make the same calls that the
    # plugin does, like so...
    dcs = $dc_observers.get_latest_class
    dcs.redraw_with_undo(sang)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an editor template for representing selecting from a dynamic dropdown list
I have a dynamic SQL statement I've created in a stored procedure. I need
I have created a dynamic TClientDataSet component and tried to fire the OnCalcFields event....it
I have created dynamic page with this code and this works fine: var b
I have created a custom component. I add a dynamic input text box to
I am new in flex.I have created dynamic web project. Run it. It accessible
I am working on Moodle 2.2.1 and have created dynamic.csv files using certain queries.
I have basic hello word example of Prime Faces. I have created dynamic web
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have created a Dynamic Data site against an Entity Framework Model I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.