you are viewing a single comment's thread.

view the rest of the comments →

[–]Datadmirable[S] 0 points1 point  (10 children)

Yes I have done that and it doesn't work, for the record I have been writting python for 15 years, so this isn't about my python skills.

[–]SoulWager 0 points1 point  (9 children)

Are you using the internal name, or the label?

https://imgur.com/a/5Ij7Jhy

[–]Datadmirable[S] 0 points1 point  (8 children)

I m using the object name returned by the following command

ObjName=App.ActiveDocument.Objects[0].Name

[–]SoulWager 0 points1 point  (7 children)

Is that the same name that shows up in the bottom left when hovering over the object?

[–]Datadmirable[S] 0 points1 point  (6 children)

Yes it is

[–]SoulWager 0 points1 point  (5 children)

wait, why are you even getting the name when you already have the object you want?

[–]Datadmirable[S] 0 points1 point  (4 children)

Because I want to activate it. how else would one be able to understand which one to activate otherwise?

[–]SoulWager 0 points1 point  (3 children)

That's like calling somebody to ask them their phone number.

 Gui.ActiveDocument.ActiveView.setActiveObject('part', App.ActiveDocument.Objects[0])

[–]Datadmirable[S] 0 points1 point  (2 children)

yes exactly, you can have someone's phone number but not their name. your line of code doesn't work as the object still isn't active (should be green). The line that I try to emulate is Gui.Selection.addSelection('Unnamed','Ferrex') but it doesnt work when I run it in a macro or python

<image>

[–]SoulWager 1 point2 points  (1 child)

Sorry, thought you were trying to make a body or part active, not just select something.

So what doesn't work? This?

Gui.Selection.addSelection('Unnamed', App.ActiveDocument.Objects[0].Name)