sketchucation logo sketchucation
    • Login
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Components colors/materials retrieval

    scheduled pinned locked moved Developers' Forum
    5 Posts 2 Posters 788 Views 2 Watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • Didier BurD Offline
      Didier Bur
      last edited by

      Hi all,
      I can't figure out to do this:

      • Suppose you have component instances in your model, each of them made of several various sub-components. These sub-components have also been painted by the user with various colors.

      • I can easily iterate through the top-level instances list, but once there I cannot retrieve the individual color or material of each sub_component, because there is no method "ComponentInstance.entities", these entities can only be accessed through the parent definition.

      Pleeeaaase help ! πŸŽ‰

      DB

      one-reply-to-this-post last-reply-time reply quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        @didier bur said:

        Hi all,
        I can't figure out to do this:

        • Suppose you have component instances in your model, each of them made of several various sub-components. These sub-components have also been painted by the user with various colors.

        • I can easily iterate through the top-level instances list, but once there I cannot retrieve the individual color or material of each sub_component, because there is no method "ComponentInstance.entities", these entities can only be accessed through the parent definition.

        Pleeeaaase help ! πŸŽ‰

        If you can get the component_instance [of a nested component_definition] that is itself inside another component_definition (get that parent's component_instance.definition.entities and mine down into it for any component_instances... to use) - then you can then get any nested component_instance.material... = nil if it's <default> or 'a_material' if it's been painted. Within any component_definition.entities you can check any face/edge for e.g. face.material (again nil=<default>)...

        Hope this helps...

        TIG

        one-reply-to-this-post last-reply-time reply quote 0
        • Didier BurD Offline
          Didier Bur
          last edited by

          @unknownuser said:

          Hope this helps...

          Sure, sort of. Thanks TIG.
          Guess what ? I must dig into 3 levels deep components to get their colors (for a client). This is more tricky than it first sounded. 😲

          DB

          one-reply-to-this-post last-reply-time reply quote 0
          • TIGT Offline
            TIG Moderator
            last edited by

            My ComponentReporter+.rb has some component/group mining techniques in it that might help...

            Good luck (bon chance!).

            TIG

            one-reply-to-this-post last-reply-time reply quote 0
            • Didier BurD Offline
              Didier Bur
              last edited by

              Yes, I've studied it extensively... But what I didn't noticed before is that when you have a component within another component and when you paint this sub-component globally (by default) you thus modify its definition. That's to say you can't have this sub-component colored with 2 different colors in to separate "parents". I hope that I'm clear, anyway this makes my job a lot easier
              I must extract an Excel sheet with a global list of top-level furniture components (kitchen cabinets, shelves...), and a detailed list of the components of level 1 whith their colors/materials, themselves made of various pieces of level 2 of various colors/materials.
              Pfff, furniture manufacturers are complicated people sometimes...

              P.S. Typo: Bonne chance (thanks)

              DB

              one-reply-to-this-post last-reply-time 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