I am absolute noob in this area but I decided to do something with it. I'd like to achieve this: there is a drawing with a geometry - lets say a circle - and attribute definition. What I like to do is to scale everything in the drawing by 2 and additionaly to move attribute to nearest grid point (if an attribute definition is located in [10.1,14.9] it should be moved to [10,15]. To be honest I know how to create new simple objects, but I dont know how to handle existing stuff and have no idea how to query location from attribute definitions.
Any help appreciated! Thanks!
ps: VS2013/ACAD2015
example drawings in 2010/2013 format:
http://www40.zippyshare.com/v/37899772/file.html
http://www40.zippyshare.com/v/83044603/file.html
UPDATE: I made some progress on this issue. The scaling was done by using command:
acDoc.SendStringToExecute("_ai_selall\n", true, false, false);
acDoc.SendStringToExecute("scale\n", true, false, false);
acDoc.SendStringToExecute("0,0\n", true, false, false);
acDoc.SendStringToExecute("2\n", true, false, false);
Then I did an iterate through Block Table Record (looking for ATTDEF):
BlockTableRecord acBlkTblRec;
acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
foreach (ObjectId acObjId in acBlkTblRec) { ... } etc.
And at the end I expected to save modified file (again through SendStringToExecute).
acDoc.SendStringToExecute("qsave\n", true, false, false);
acDoc.SendStringToExecute("close\n", true, false, false);
However it doesn't work as I'd though it will. As I planned to process a list of files it starts to open file by file, do something with that but not in order it suppose to do. It opens the file then process of scaling and fixing the location of attributes is mixed(!). I found out it has something to do with SendStringToExecute/Autocad.
So now I have to find out how to keep my sequence as I planned.