Can I edit the "Protected" parameter of a named selection from a script?

Here is what is returned from Tree.FirstActiveObject.Properties
when a named selection object is selected:
[GeometryDefineBy, GeometrySelection, SendToSolver, ProtectedTopology, SendAs, CosimulationInterface, Visible, IncludePCInflation, PreserveDuringSolve, ImportedFromCAD, NumInSelection, LengthOfEdges, AreaOfFaces, NumSuppressedItems, NumHiddenItems, WorksheetMeshing, CreatedForCrack, CrackFrontNumber, ToleranceType, ZeroTolerance, RelativeTolerance, AngularTolerance, LSDynaUserId, Source, ReadOnly]
The fourth item in the list is ProtectedTopology
and corresponds to the "Protected" property in the screenshot below:
However, when I execute dir(Tree.FirstActiveObject)
, I get this list:
['Accept', 'Activate', 'AddComment', 'AddFigure', 'AddImage', 'AwaitObjectDuplicate', 'BaseObject', 'Children', 'Comments', 'CopyTo', 'CrackFrontNumber', 'CreateNodalNamedSelection', 'CreateObjRef', 'CreateParameter', 'CreatedForCrack', 'DataModelObjectCategory', 'Delete', 'Duplicate', 'ElementFaceIndices', 'Entities', 'Equals', 'ExportNamedSelectionToCDBFile', 'ExportToTextFile', 'Figures', 'Generate', 'GenerationCriteria', 'GetAPIName', 'GetAllProperties', 'GetChildren', 'GetEnumName', 'GetHashCode', 'GetIconFile', 'GetLifetimeService', 'GetObjectData', 'GetParameter', 'GetPath', 'GetPropertyName', 'GetPropertyValue', 'GetType', 'GetVisibleProperties', 'GetVisiblePropertyNames', 'GroupAllSimilarChildren', 'GroupSimilarObjects', 'GroupingFolder', 'IconName', 'Id', 'Ids', 'Images', 'ImportableObjectSourceId', 'IncludeProgramControlledInflation', 'InitializeLifetimeService', 'InternalObject', 'IsPropertyEditable', 'IsPropertyVisible', 'IsValid', 'LSDynaUserId', 'Location', 'MemberwiseClone', 'Name', 'ObjectId', 'ObjectState', 'ObjectTags', 'Parent', 'PreserveDuringSolve', 'Properties', 'PropertyByAPIName', 'PropertyById', 'PropertyByName', 'ReadOnly', 'ReferenceEquals', 'RelativeTolerance', 'RemoveParameter', 'ScopingMethod', 'SelectionType', 'SendAs', 'SendToSolver', 'SolverName', 'State', 'Suppressed', 'ToString', 'ToleranceType', 'TotalSelection', 'TransferableObjectId', 'Type', 'UsedByMeshWorksheet', 'Visible', 'VisibleProperties', 'Worksheet', 'ZeroTolerance', '__class__', '__delattr__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_selMgr']
Unless I'm missing something, this does not appear to include an item that corresponds to the "Protected" property. Furthermore, Tree.FirstActiveObject.Properties[3].APIName
(which normally returns the property corresponding to the given parameter) returns None
.
Best Answer
-
@tlewis3348 There is currently no direct API for this, hence
APIName is None
I have submitted an enhancement to add API exposure for this property.
@mohamed-koubaa , FYI1
Answers
-
This is not exposed. You will have to use InternalObject.
obj.InternalObject.Protected
Please note that internal objects may change in future.
0 -
Thanks!
Is there a means of getting the equivalent of the
APIName
from the item in theProperties
list? In this case, it appears that the `Caption0 -
` property would work. But that obviously wouldn't always work (e.g., if there were spaces in the caption).
0 -
@Landon Mitchell Kanner, Thanks!
0