‎17-07-2017 06:12 PM - edited ‎17-07-2017 06:15 PM
Hi,
I am trying to write a simple script to disconnect one object from another object but I receive the following error;
Script Editor Default : Object Deletion Error line 16, offset 10 :
Error(0x800aa200) : Object ~odAkCZBsq400{MetaClass}[External reference] : Error, updating not possible
My code is below - am I doing something wrong or is this a permissions error? Any help would be greatly appreciated.
Set oRoot = object.GetRoot
Set oExtRefs = oRoot.GetSelection("Select [External Reference] Where [Operation]'")
For Each oExtRef in oExtRefs
oExtRefName = oExtRef.GetProp("Short Name")
Set oOperations = oRoot.GetSelection("Select [Operation] Where [External Reference].[Short Name] Like '" & oExtRefName & "'").Item(1)
For each oOperation in oOperations
oExtRef.Remove oOperation
Next
Next
‎04-08-2017 11:01 AM
Set oRoot = object.GetRoot
Set oExtRefs = oRoot.GetSelection("Select [External Reference] Where [Operation]'")
for each oExtRef in oExtRefs
oExtRefName = oExtRef.GetProp("Name")
print oExtRef.GetProp("Name")
Set oOperations = oExtRef.GetCollection("operation")
For each oOperation in oOperations
print oOperation.GetProp("Name")
oOperation.Remove oExtRef
Next
next