澳门至尊网站-首页

您的位置:澳门至尊网站 > 软件综合 > 改良填充区域的填充样式

改良填充区域的填充样式

2019-10-23 05:33

话十分的少说,直接上代码

var target = pattern.Target;
var name = pattern.Name;
var fpElem = FillPatternElement.GetFillPatternElementByName(doc, target, name);

using (var tran = new Transaction(doc, "FillPattern"))
{
       tran.Start();
       var selectionIds = app.ActiveUIDocument.Selection.GetElementIds();
       if (selectionIds != null && selectionIds.Any())
       {
            foreach (var id in selectionIds)
            {
                    FilledRegion elem = doc.GetElement(id) as FilledRegion;
                    if (elem != null && !elem.IsMasking)
                    {                                
                          OverrideGraphicSettings overrideGraphicSettings = new OverrideGraphicSettings();
                          overrideGraphicSettings = doc.ActiveView.GetElementOverrides(elem.Id);
                          overrideGraphicSettings.SetProjectionFillPatternId(fpElem.Id);
                          doc.ActiveView.SetElementOverrides(elem.Id, overrideGraphicSettings);
                    }
             }                        
        }
        tran.Commit();
}

 

本文由澳门至尊网站发布于软件综合,转载请注明出处:改良填充区域的填充样式

关键词:

  • 上一篇:没有了
  • 下一篇:没有了