DC child component
-
hi
i have just started experimenting with dc, and i have a quick question.
i have a group - "char", that contains two groups "seat", "legs".
i have added a onClick behavior that i would like to hide / show the legs (just for testing).
i thought i could do something like legs.SET("hidden", 0, 1), but that gives an error.
i can ad the onclick behavior direct at the "legs", but when they are hidden, i can't click to show them again - so i thought the solution could be to add the behavior to the parent.
is it possible to access childs from the main group?
thanks
jorgensen -
create an attribute say called hide in the parent and give it a value 0, toggle this via the onClick with SET("hide", 0, 1).
Then for hidden attribute value within the children(legs)
hidden = parent!hide (or char!hide)
-
-
hi pcmoor
thank you very much for your fast reply.
i have opened your file and it works just fine!
i have tried to replicate the same behavior to my own model, but i can't get it to work - though it seems that i have done exactly the same.
could i ask you to test the file? it might just be a typeping error
-
hav't an explanation to why example 2 does not work, however able to fix using example 1
will look into it tomorrow
-
the difference between my examples (hide.skp) and your model (save.skp) is the parent is a component in mine whereas yours is a group. It appears groups can't pass down a value, but rather they need to reference the parent.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement