コード例 #1
0
        public void ApplySettingForDisplay(View view, List <ElementId> elementIds)
        {
            OverrideGraphicSettings setting = GetOverrideGraphicSettings(view.Document);

            foreach (var elementId in elementIds)
            {
                Revit_Helper.ApplyOverrideGraphicSettings(view, elementId, setting);
            }
        }
コード例 #2
0
        /// <summary>
        /// 解除对元素增加的节点的配置
        /// </summary>
        /// <param name="element"></param>
        void DeapplySetting(View view, ElementId elementId)
        {
            Revit_Helper.ApplyOverrideGraphicSettings(view, elementId, VLConstraints.DefaultCPSettings);

            //var group = view.Document.GetElement(elementId) as Group;
            //if (group != null)
            //{
            //    foreach (var memberId in group.GetMemberIds())
            //        view.SetElementOverrides(memberId, EarthworkBlockingConstraints.DefaultCPSettings);
            //}
            //else
            //{
            //    view.SetElementOverrides(elementId, EarthworkBlockingConstraints.DefaultCPSettings);
            //}
        }
コード例 #3
0
        public void ApplySettingWithoutTransaction(TEarthworkBlocking blocking, List <ElementId> elementIds)
        {
            if (elementIds == null || elementIds.Count == 0)
            {
                return;
            }
            OverrideGraphicSettings setting = GetOverrideGraphicSettings(VLConstraints.Doc);

            //元素可见性
            if (IsVisible)
            {
                VLConstraints.View3D.UnhideElements(elementIds);
            }
            else
            {
                VLConstraints.View3D.HideElements(elementIds);
            }
            //元素表面填充物配置
            foreach (var elementId in elementIds)
            {
                Revit_Helper.ApplyOverrideGraphicSettings(VLConstraints.View3D, elementId, setting);
            }
        }
コード例 #4
0
        /// <summary>
        /// 对元素增加节点的配置
        /// </summary>
        /// <param name="element"></param>
        //void ApplySetting(View view, ElementId elementId, OverrideGraphicSettings setting)
        //{
        //    var group = view.Document.GetElement(elementId) as Group;
        //    if (group != null)
        //    {
        //        foreach (var memberId in group.GetMemberIds())
        //            view.SetElementOverrides(memberId, setting);
        //    }
        //    else
        //    {
        //        view.SetElementOverrides(elementId, setting);
        //    }
        //}
        void ApplySetting(View view, ElementId elementId)
        {
            OverrideGraphicSettings setting = GetOverrideGraphicSettings(view.Document);

            Revit_Helper.ApplyOverrideGraphicSettings(view, elementId, setting);
        }