.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eOnLockedLayer!!! Yet I know it is not!

1 REPLY 1
SOLVED
Reply
Message 1 of 2
js75CAD
136 Views, 1 Reply

eOnLockedLayer!!! Yet I know it is not!

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?

1 REPLY 1
Message 2 of 2
kdub_nz
in reply to: js75CAD

>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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost