question

Tee Hiett avatar image
0 Likes"
Tee Hiett asked Ryan Clark commented

How do I unprotect a list so I can delete it?

Protected lists.jpg

Somehow in my Learning to Use Lists, I inadvertently protected the first three lists as shown in the attached JPEG. When I try to delete these lives I get the message that they are protected and cannot be deleted.


How did I protect them and how can I unprotect them so I can delete them?


Thanks

FlexSim 21.2.4
global listdelete list
protected-lists.jpg (60.9 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Tee Hiett, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

The default HC lists are protected. If you duplicate them the protected status will be copied to the new list as well. Other than that I don't really a way to accidently protect a list.

You can use the "switch_protected()" command to unset the protected status. Write the command in the script window (Debug -> Script Console) and insert the object, or in this case list, that you want to protect/unprotect (the list has to be cast as an object/treenode, so you have to add ".as(treenode)" to the list reference). The second parameter determines if you switch the flag on (1) or off (0).

1646293796275.png

After running the command, you should be able to delete the list.


1646293796275.png (10.5 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.