本文整理汇总了C#中ModelDoc2.HideComponent2方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.HideComponent2方法的具体用法?C# ModelDoc2.HideComponent2怎么用?C# ModelDoc2.HideComponent2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelDoc2
的用法示例。
在下文中一共展示了ModelDoc2.HideComponent2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hideComponents
//Hides the components from a list
public static void hideComponents(ModelDoc2 model, List<Component2> components)
{
selectComponents(model, components, true);
model.HideComponent2();
}
示例2: HideCompAndShowCross
private bool HideCompAndShowCross(ModelDoc2 swModel, string f1, string f2, out string comp1Name, out string comp2Name,
out List<Component2> list)
{
bool ret = false;
Component2 swComp1, swComp2;
list = new List<Component2>();
comp1Name = " ";
comp2Name = " ";
if (GetComponentByName(swModel, f1, false, out swComp1) &&
GetComponentByName(swModel, f2, false, out swComp2))
{
var swComponents = new LinkedList<Component2>();
comp1Name = swComp1.Name;
comp2Name = swComp2.Name;
if (comp1Name != comp2Name)
{
var swConfig = (Configuration)swModel.GetActiveConfiguration();
if (swConfig != null)
{
var swRootComponent = (Component2)swConfig.GetRootComponent();
if (GetComponents(swRootComponent,
swComponents, false, false))
{
foreach (var component in swComponents)
{
if ((component.Name != swComp1.Name) && (component.Name != swComp2.Name) &&
(component.Visible == 1))
{
component.Select(false);
swModel.HideComponent2();
swModel.ClearSelection();
list.Add(component);
ret = true;
}
}
return ret;
}
}
}
}
return false;
}