As a BlockReference type, it must have a color property, and the property must be Autodesk.Autocad.Colors.Color or Integer. Also the reason you get the object to read is because in your transaction you open the database with
OpenMode.ForRead
And it is right. But to edit an object in the database, you must get the object, as shown below.
var obj = Thetransaction.GetObject(theobjectid,OpenMode.ForWrite) as BlockReferance;
It is done inside
using(var trans = TransactionManager.StartTransaction()){}
I do this on a cell, so check the camel case and syntax, because I write in C #, but it should be pretty close.
You might want to know if there is a scale property to resize.
Hope this moves you in the right direction.
Let me know if you have any problems. :)
source share