How to Get properties of the Layer

How to Get properties of the Layer

Anonymous
Not applicable
626 Views
2 Replies
Message 1 of 3

How to Get properties of the Layer

Anonymous
Not applicable
Hi

I am new to autocad.net . i have couple of doubt's

1) how to list all the layer in a diagram
2) how to read each layer properties ??


i am using DotnetARX & c# to access the file . If anyone have sample file to show how to access diagram and it's entity properties . can you send it to me ?

Thanks for the help

Regards,
Elam
0 Likes
627 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Good luck getting help on these forums. More than likely you will get Tony Tanzillo telling you what an idiot you are for even asking.

my experience with ADN was not much better. you would think that paying $1300 for tech support would render something useful.
0 Likes
Message 3 of 3

Anonymous
Not applicable
This is a sub that I wrote in VB.NET to change a layer's freeze state. With the quick research I did I could not find a mechanism for finding a specific layer without looping through them...

{code}
Sub freezeMe(ByRef tr As Transaction, ByVal lname As String, ByVal freeze As Boolean)
Dim lt As LayerTable = tr.GetObject(HostApplicationServices.WorkingDatabase.LayerTableId, OpenMode.ForWrite, False, False)
For Each i In lt
Dim tt As LayerTableRecord = tr.GetObject(i.GetObject(OpenMode.ForWrite).ObjectId, OpenMode.ForWrite, False, False)
If tt.Name = lname Then
tt.IsFrozen = freeze
End If
Next
End Sub
{code}
Each element in the LayerTableRecord has properties of the layers such as isFrozen, isLocked, etc. See the helpfiles for a full list of properties.

Opening a drawing is fairly well documented in the samples, helpfiles and on these forums.
0 Likes