Notifications
Clear all

[Closed] Problem with Groups

I’m making a script where you select and xref’d group, and it reloads it and any of its children (if there are new children, they’re added, and if children are moved relative to it, they’re moved), however i’m having trouble recognising a group.

If a group is closed, “isGroupHead $” it says “– Runtime error: isGroupHead requires a node”.

If I try “setGroupOpen $ true”, I get the same issue.

So yeah, i’m stuck on the first step, which is determining if i’ve got a group selected.

2 Replies

your $ = selection is collection of selected objects. But that function require input node, so it made error. You should to access each object of that selection


for obj in selection do
(
   if (isGroupHead obj) then
      setGroupOpen obj true --or anything you want
)

Of course! Thanks