1. Firstly, I want to apologize for the avalanches of the threads created by me.
2. Secondly, I want to ask you if you know where could I find Autocad .Net
2011 Developer Guide as a pdf. (this is not so important)
3. How can you modify the components of a BlockReference.
I have an XXX (a Civil Entity), which I explode it and I obtain a BlockReference.
I take the BlockReference and exploded it and I get the components (MTexts).
I modify the Contents attribute of the Mtext object, but I don't see any changes in the drawing.
So, any ideas? Maybe there is fundamental thing which I don't see.
[CommandMethod("app")]
public static void app()
{
Document document = Application.DocumentManager.MdiActiveDocument;
Database database = document.Database;
Editor editor = Application.DocumentManager.MdiActiveDocument.Editor;
String caleDirector = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + "NumeroteazaKilometrii\\";
listAx = new List<Entity>();
using (Transaction transaction = database.TransactionManager.StartTransaction())
{
Entity minor;
DBObjectCollection dBObjectCollection = new DBObjectCollection();
PromptSelectionResult promptSelectionResult = Helper.selectEntities("Minor", document, true);
if (promptSelectionResult.Status == PromptStatus.OK)
{
SelectionSet selectionSet = promptSelectionResult.Value;
minor = transaction.GetObject(selectionSet[0].ObjectId, OpenMode.ForWrite) as Entity;
if (minor == null) return;
}
else
{
return;
}
if (minor is AlignmentMinorStationLabelGroup)
{
minor.Explode(dBObjectCollection);
foreach (Entity elementAx in dBObjectCollection)
{
listAx.Add(elementAx);
}
Entity minor2 = listAx[0];
dBObjectCollection.Clear();
listAx.Clear();
BlockReference block = null;
if (minor2 is BlockReference)
{
block = minor2 as BlockReference;
}
if (block != null)
{
block.Explode(dBObjectCollection);
foreach (Entity e in dBObjectCollection)
{
if (e is MText)
{
MText mText = e as MText;
mText.Contents = "BlaBlaBla";
}
}
}
}
transaction.Commit();
}
}