Entity.AutodeskProperties

With Eyeshot2020 we introduced a new property of type AutodeskMiscProperties of the Entity class called AutdoeskProperties. This class gathers inside it some miscellaneous Autodesk properties such as curve thickness, the thickness extrusion direction, and the entity XData. 

Now to read and write the entity XData you need to proceed as follow: 

Line line = new Line(0, 0, 0, 100, 100, 100);
List<KeyValuePair<short, object>> myList = new List<KeyValuePair<short, object>>();
myList.Add(new KeyValuePair<short, object>(1001, "MyAPP"));
myList.Add(new KeyValuePair<short, object>(1000, "BlaBlaBla"));
line.AutodeskProperties=new AutodeskMiscProperties(myList);
line.AutodeskProperties.Thickness=3; // here we set also the line thickness
model1.Entities.Add(line);
WriteAutodeskParams wrp = new WriteAutodeskParams(model1) {Version = WriteAutodesk.versionType.Acad2007};
WriteAutodesk wra=new WriteAutodesk(wrp, "test.dwg");
wra.DoWork();
ReadAutodesk ra = new ReadAutodesk("test.dwg");
ra.DoWork();
ra.AddToScene(model1);
Entity first = model1.Entities.First();
Console.WriteLine("XData values:");
foreach (var pair in first.AutodeskProperties.XData)
{
    Console.WriteLine(pair.Value);
}

More details on AutoCAD extended entity data can be found here

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.