Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Can't change hidden object visibility in newly created headless document

$
0
0

Hi!
I’m running into a weird issue:

  • I create a headless document and populate it with existing objects using a script.
  • Some of the objects are hidden.
  • From here I learned that one should use the GetObjectList() function to iterate over all objects - including hidden objects.
  • I have then tried to make the hidden objects visible in the headless doc:
    • Using headless.Objects.Show(obj, True)
    • Setting obj.Attributes.Mode = ObjectMode.Normal and then calling obj.CommitChanges()
    • Duplicating the object attributes, setting Mode to ObjectMode.Normal and then headless.Objects.ModifyAttributes(obj, attr, True)

None of these seem to work. When I write and open the headless doc, the hidden objects are there, but they remain hidden. I need to manually call the Show command to reveal them.

Bonus: When I iterate over all the objects, I also call obj.Attributes.WireDensity = -1 to get rid of isolines in the new doc (for legibility). This works for the visible objects but when I manually reveal the hidden objects, they have not been affected. Are attributes of hidden objects not editable? I try to unhide/show the objects before setting the wire density, if that helps…

Am I missing something? Is there another undocumented approach as in the link?

Best,

Tom

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles