Lock Component with Python

Hi there,

Does anyone know if it is possible to lock a Component with Python?
I know there is a button in the property screen next to the ‘Metadata’ button that says ‘Lock Object’.
I want to attach some parts to a component and give it the possibility to not unattach itself when someone accidentally select it and and move it.

If locking with python is not possible, does anyone know a different approach for attachments to components to be locked and make sure they can not unattach?

Thanks.

At a quick glance, it looks like vcComponent has a property “Locked”.

I wonder if
comp = getComponent()
comp.Locked = True

works

br,
Lefa

a little late but thanks, that indeed works great.
Don’t know how I missed that Locked feature