I have a simple routine. I select all of the blocks very specifically by name. I know FOR A FACT that none of them are on a locked layer.
Yet every single time, this idiotic program tries to tell me they are and refuses to accept the routine. Why can't AutoDESK include a simple function that If it is locked , THEN SKIP IT!
Can anyone tell me how to ensure that it finishes?
Dim brs = From a In bt Where UCase(a.Name).startswith("MRT")
For Each oID As ObjectId In btr.GetBlockReferenceIds(True, True)
If btrID.IsEffectivelyErased Then Continue For
Dim btr As BlockTableRecord = CType(tr.GetObject(btrID, OpenMode.ForRead, False, True), BlockTableRecord)
If btr.IsFromExternalReference = True Or btr.IsLayout = True Then Continue For
For Each oID As ObjectId In btr.GetBlockReferenceIds(True, True)
Dim br As BlockReference = tr.GetObject(oID, OpenMode.ForWrite, False, True)
Next
Next
I have one layer. ONE! It has an xreference on it. Yes, the bloody thing is locked, but it is not even loaded and should not even be picking this!
Why is this so hard?
Solved! Go to Solution.
Solved by kdub_nz. Go to Solution.
>quote >> Why can't AutoDESK include a simple function that If it is locked , THEN SKIP IT! <<<
The
LayerTableRecord
has a property
IsLocked
which will be either true or false
// Called Kerry in my other life.
Everything will work just as you expect it to, unless your expectations are incorrect.
class keyThumper<T> : Lazy<T>; another Swamper