Hi Guys,
Requirement : Scan all shape elements(polygons) in active dgn and then make them fill and set transparency.(Fill mode on off)
buy using below code i am giving 30 percentage transparency ( txt_trans_per.Text ) but it is applying with 100 percent.
please let me know where i am doing mistake .
BIM.Application mstnApp = BMI.Utilities.ComApp;
BIM.ElementScanCriteria esc = new BIM.ElementScanCriteriaClass();
esc.IncludeOnlyVisible();
esc.ExcludeAllTypes();
esc.IncludeType(BIM.MsdElementType.Shape);
BIM.ElementEnumerator ee = mstnApp.ActiveModelReference.Scan(esc);
if (BtClick == false)
{
while (ee.MoveNext())
{
BIM.Element Elm = ee.Current;
Elm.AsShapeElement().FillMode = BIM.MsdFillMode.Filled;
Elm.Transparency = Convert.ToInt32(txt_trans_per.Text);
mstnApp.ActiveModelReference.ReplaceElement(Elm,Elm);
}
BtClick = true;
Bt_FillMode.Text = "Polygon Fill Mode : OFF";
}
else
{
while (ee.MoveNext())
{
BIM.Element Elm = ee.Current;
Elm.AsShapeElement().FillMode = BIM.MsdFillMode.NotFilled;
Elm.Transparency = 0;
mstnApp.ActiveModelReference.ReplaceElement(Elm, Elm);
}
BtClick = false;
Bt_FillMode.Text = "Polygon Fill Mode : ON";
}