0
矩形の2つのパラメータ(par_lとpar_h)を持つ動的ブロックを作成しました。なぜこの場合、何も起こらないのですか?私はpar_lが500に項目を拡張する必要があると仮定します。デフォルトでは私は100と100を持っています。 私がプログラムで作成したブロック。 C#でのコードで、私はそれを操作したいC#でダイナミックブロックを操作する(AutoCad用)
[CommandMethod("Elem")]
public void TestCommand()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
Transaction tr = db.TransactionManager.StartTransaction();
BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForWrite);
ed.WriteMessage(bt["prz_podl"]+"");
BlockTableRecord btr = tr.GetObject(bt["prz_podl"], OpenMode.ForWrite) as BlockTableRecord;
Point3d point = new Point3d(0, 0, 0);
BlockReference br = new BlockReference(point, btr.Id);
br.BlockTableRecord = btr.Id;
DynamicBlockReferencePropertyCollection properties = br.DynamicBlockReferencePropertyCollection;
for (int i = 0; i < properties.Count; i++)
{
DynamicBlockReferenceProperty property = properties[i];
if (property.PropertyName == "par_l")
{
ed.WriteMessage(property.Value+"");
property.Value = 500.0;
}
}
tr.Commit();
}