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

How to Get properties of the Layer

2 REPLIES 2
Reply
Message 1 of 3
DigiFly
356 Views, 2 Replies

How to Get properties of the Layer

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
2 REPLIES 2
Message 2 of 3
askrius
in reply to: DigiFly

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.
Message 3 of 3
askrius
in reply to: DigiFly

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.

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