.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Get table name of the object data
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
How can I Get table name of the object data of a selected layer, with C#.
Thanks.
Re: Get table name of the object data
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
if you speak about "object data" do you mean the objectdata from Map3D?
If so ==> you can't assign layers objectdata (afaik). what do you mean by "selected layer"
If not ==> what do you mean by "object data".
So for both cases I guess the question is not detailed enough. Can you please give us a bit more info (maybe a sample drawing with a description what we should find there).
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Get table name of the object data
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I am working with Map3D. The objectdata from Map3D when attached can be given a name or takes the default layer name. By iterating through the Layer table can give each layer name. eg.
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
LayerTable acLyrTbl;
acLyrTbl = acTrans.GetObject(acCurDb.LayerTableId,OpenMode.Fo rRead) as LayerTable;
// Step through the Layer table and print each layer name
foreach (ObjectId acObjId in acLyrTbl)
{
LayerTableRecord acLyrTblRec;
acLyrTblRec = acTrans.GetObject(acObjId, OpenMode.ForRead) as LayerTableRecord;
acDoc.Editor.WriteMessage("\n" + acLyrTblRec.Name);
}But I want to get the objectdata table name of the active layer only. (The one in green color with the tick mark) Is it possible.?
Thanks.
Re: Get table name of the object data
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
>> The objectdata from Map3D when attached can be given a name
Yep, you can give the objectdatatable a name
>> [...] or takes the default layer name
No, that I don't understand. If you create a objectdatatable it has nothing to do with layers .... or I miss something or I misunderstand something ;(
>> But I want to get the objectdata table name of the active layer only
I guess you are asking not for objectdata, but for the layertable and layertablerecord of the active layer? If so then try this:
'get the ID from the current layer Dim tLayID As DatabaseServices.ObjectId = acCurDB.Clayer 'get the LayerTableRecord for the current layer Dim tLayTabRec As DatabaseServices.LayerTableRecord = CType(acTrans.GetObject(tLayID, DatabaseServices.OpenMode.ForRead), DatabaseServices.LayerTableRecord)
...and the LayerTableRecord can give you now all about the layer you like to have, like the .Name property.
To make sure what I mean by "objectdata": >>>click<<<
HTH, - alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Get table name of the object data
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Sorry, May be I am not able to present what I me, as I am quite new to some of the Autocad terminologies.
>> The objectdata from Map3D when attached can be given a name
Yep, you can give the objectdatatable a name
I what to get the name of this objectdatatable attached to that layer(maybe called so, in my example "C_12_Point"). But when I imported the SHP with the attributes attached to it, I named the objectdatatable as "TestTable" .
The code you had attached displays the current active layer as "C_12_Point" in my example. But I want the output as "TestTable".
thanks.
