Model Lock Follow-Up
' if the model isn't locked then a "No Change" error is returned.
On Error Resume Next
ActiveDesignFile.Models("HangerPipe").IsLocked = False
Here’s an interesting consideration. A couple of blogs back I explained how to lock models. If you’re intending to process the model programmatically you will have to unlock it. But if the model is already unlocked, as would be the case when you create the model, then make sure you check the lock status first.
If the model is unlocked and you set IsLocked to false an error is raised. So, you could use “on error resume next”, or just test the IsLocked property.
' if the model isn't locked then a "No Change" error is returned.
If ActiveDesignFile.Models("HangerPipe").IsLocked then
ActiveDesignFile.Models("HangerPipe").IsLocked = False
End If


