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

Referencing nested components - is it possible ???

Scheduled Pinned Locked Moved Dynamic Components
sketchup
6 Posts 3 Posters 1.5k Views 3 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.
  • H Offline
    Howard leslie
    last edited by 31 Oct 2009, 00:01

    Is it possible to reference nested components when using DC's ???
    ..........................................................................
    For example, 3 Components:

    1,2,3

    1 is the outer most component [Outer]
    2 is middle component [Middle]
    3 is inner most component (buried the deepest) [Inner]
    ..........

    From the Inner Component, all Parent attributes are easily referenced eg by using

    =Middle!Attribute1 OR
    =Parent!Attribute1 etc

    ..................
    HOWEVER, from the Inner Component, is it possible to reference attributes directly in the Outer most Component ???
    .................
    I've tried the obvious eg:

    Outer!Middle!Attribute1
    Parent!Parent!Attribute1
    ..................
    As a workaround, I've referenced attributes from the Outer Component to the Middle Component and then
    referenced these same attributes from the Middle Component to the Inner Component.
    (A bit like copying the attributes from one component to the next as an intermediate step).

    Its a bit cumbersome - but it does work.
    It would be much better to be able to reference such nested components directly.
    .............
    I hope this all makes sense !!!
    Any help, much appreciated.
    ...............
    Regards
    Howard Leslie

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 1 Nov 2009, 01:15

      No, references can't skip levels. So you have to do it like you did unfortunately.

      Chris

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by 1 Nov 2009, 03:53

        It may be possible with a custom Ruby function.

        It could look like this:

        
        =lookup("a")
        
        

        Which would look up the hierarchy until it found "a"; at which point it would return the value of "a" or something like "undefined" if a was not found.

        Hi

        1 Reply Last reply Reply Quote 0
        • H Offline
          Howard leslie
          last edited by 4 Nov 2009, 11:21

          Chris / Jim,
          Thanks very much for your replies.
          It's as I suspected, but it's really good to get confirmation from peers as DC's aren't comprehensivley documented.
          ...........
          A possible request for a future enhancement for DC's - ability to reference any attribute from any level ???
          ...........
          Regards
          Howard L'

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by 5 Nov 2009, 03:24

            Howard, I can see if I can write this method if it would be of use. If you were to use such a method, it would need to be distributed along with the DC so other people could use it.

            Hi

            1 Reply Last reply Reply Quote 0
            • H Offline
              Howard leslie
              last edited by 5 Nov 2009, 18:55

              Jim,
              Thank you very much for the offer to write some Ruby code for this.
              However, there's no real need to put yourself to the trouble.
              I can work around the problem OK for now.
              ............................................
              As suggested earlier though, a way of having something built into the core program in the future would be good.
              A possible enhancement for SU V8 ???
              .............................................

              In the days of DOS we used ...... to go up levels in directory trees.

              A similar feature for DCs in the future would be really good eg

              Parent!Parent!Parent!Attribute1 - ie a way to navigate up levels in RELATIVE terms
              ..............................................
              Regards
              Howard L'

              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