With below code, it shows 'NoState' for Joint ObjectState. It's incorrect status. But out of Transaction, it shows the correct status UnderDefined.
My question is how to get the correct ObjectState within Transaction(True):, so that it can go PromoteToRemotePoint successfully.
Because in my real case, there may be more than 100 Joints that need to do PromoteToRemotePoint, so think to do it with Transaction for speed purpose.
with Transaction(True):
CreateJoint=ExtAPI.DataModel.Project.Model.Connections.AddJoint()
CreateJoint.ConnectionType=JointScopingType.BodyToBody
CreateJoint.Type=JointType.Fixed
print 'in Transaction: '+str(CreateJoint.ObjectState)
if CreateJoint.ObjectState==ObjectState.UnderDefined:
CreateJoint.PromoteToRemotePoint()
print 'out of Transaction: '+str(CreateJoint.ObjectState)
Output:
in Transaction: NoState
out of Transaction: UnderDefined