- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
I have a program to read standard (line, mtext, etc) coordinates.
But, I need to read custom properties added to objects (I can see with right button, properties).
What is the method?
I'm writing a module in c#.
My code:
Database db=HostApplicationServices.WorkingDatabase;
Transaction tr=db.TransactionManager.StartTransaction();
BlockTable bt=(BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForRead);
BlockTableRecord btr=(BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
foreach(ObjectId idobj in btr)
{
ed.WriteMessage(idobj.ObjectClass.DxfName);
if(idobj.ObjectClass.DxfName.CompareTo("LINE")==0)
{
Line e=tr.GetObject(idobj, OpenMode.ForRead, false) as Line;
ed.WriteMessage(e.StartPoint+" "+e.EndPoint); // coordinates
}
}
You can see a printscreen with information of custom properties (title "Personalizado" and values "diamertro", "material", "espesor")
Solved! Go to Solution.