[ProStructures]通过代码,如何单独修改一根钢筋的直径和颜色,长度,锚固方式等;如何单独删除一根钢筋

PsMiscTools tools = new PsMiscTools();
PsSelection pseclect = new PsSelection();
PsMatrix psmatrix = new PsMatrix();
long Id;
Id = pseclect.PickObject("Select the object to be copied!");


PsTransaction transaction = new PsTransaction();

// The incoming managed object reference must be empty when GetObject is called
PsRebarSingle rebarObject = null;
Bentley.ProStructures.Concrete.Shape.PsConcreteShape pscon = null;
try
{
if (transaction.GetObject(Id, PsOpenMode.kForWrite, ref rebarObject))
{
rebarObject.ModifyRebarColors(0, 10);
rebarObject.Color = 10;
rebarObject.Diameter = 12;

transaction.GetObject(rebarObject.ConcreteId, PsOpenMode.kForWrite, ref pscon);
bool isupdate = false;
PsConcrete tcon = pscon.GetConcrete();
isupdate = tcon.removeRebarObject(Id, true);

}

通过上面的方法可以修改钢筋里面的信息数据,但是在PS中显示还是原来的信息;
通过PsConcrete删除钢筋返回了true,但是在PS中钢筋并没有被删除。

Parents Reply Children
No Data