Beispiel #1
0
 public static void SetLineWidth(DisplayType type, Width widthType)
 {
     PartObject.WidthType  width    = ConvertLineWidthType((DisplayableObject.ObjectWidth)widthType);
     NXOpen.Part           workPart = (NXOpen.Part)WorkPart;
     PartObject.ObjectType type3    = (PartObject.ObjectType)type;
     workPart.Preferences.ObjectPreferences.SetWidth(type3, width);
 }
Beispiel #2
0
 private static DisplayableObject.ObjectWidth ConvertLineWidthType(PartObject.WidthType widthType)
 {
     if (widthType == PartObject.WidthType.NormalWidth)
     {
         return(DisplayableObject.ObjectWidth.Normal);
     }
     if (widthType == PartObject.WidthType.ThickWidth)
     {
         return(DisplayableObject.ObjectWidth.Thick);
     }
     if (widthType == PartObject.WidthType.ThinWidth)
     {
         return(DisplayableObject.ObjectWidth.Thin);
     }
     if (widthType == PartObject.WidthType.WidthOne)
     {
         return(DisplayableObject.ObjectWidth.One);
     }
     if (widthType == PartObject.WidthType.WidthTwo)
     {
         return(DisplayableObject.ObjectWidth.Two);
     }
     if (widthType == PartObject.WidthType.WidthThree)
     {
         return(DisplayableObject.ObjectWidth.Three);
     }
     if (widthType == PartObject.WidthType.WidthFour)
     {
         return(DisplayableObject.ObjectWidth.Four);
     }
     if (widthType == PartObject.WidthType.WidthFive)
     {
         return(DisplayableObject.ObjectWidth.Five);
     }
     if (widthType == PartObject.WidthType.WidthSix)
     {
         return(DisplayableObject.ObjectWidth.Six);
     }
     if (widthType == PartObject.WidthType.WidthSeven)
     {
         return(DisplayableObject.ObjectWidth.Seven);
     }
     if (widthType == PartObject.WidthType.WidthEight)
     {
         return(DisplayableObject.ObjectWidth.Eight);
     }
     return(DisplayableObject.ObjectWidth.Nine);
 }
Beispiel #3
0
 private static DisplayableObject.ObjectWidth ConvertLineWidthType(PartObject.WidthType widthType)
 {
     if (widthType == PartObject.WidthType.NormalWidth)
     {
         return(DisplayableObject.ObjectWidth.Normal);
     }
     if (widthType == PartObject.WidthType.ThickWidth)
     {
         return(DisplayableObject.ObjectWidth.Thick);
     }
     if (widthType == PartObject.WidthType.ThinWidth)
     {
         return(DisplayableObject.ObjectWidth.Thin);
     }
     //if (widthType == PartObject.WidthType.WidthOne)
     //{
     //    return DisplayableObject.ObjectWidth.One;
     //}
     //if (widthType == PartObject.WidthType.WidthTwo)
     //{
     //    return DisplayableObject.ObjectWidth.Two;
     //}
     //if (widthType == PartObject.WidthType.WidthThree)
     //{
     //    return DisplayableObject.ObjectWidth.Three;
     //}
     //if (widthType == PartObject.WidthType.WidthFour)
     //{
     //    return DisplayableObject.ObjectWidth.Four;
     //}
     //if (widthType == PartObject.WidthType.WidthFive)
     //{
     //    return DisplayableObject.ObjectWidth.Five;
     //}
     //if (widthType == PartObject.WidthType.WidthSix)
     //{
     //    return DisplayableObject.ObjectWidth.Six;
     //}
     //if (widthType == PartObject.WidthType.WidthSeven)
     //{
     //    return DisplayableObject.ObjectWidth.Seven;
     //}
     //if (widthType == PartObject.WidthType.WidthEight)
     //{
     //    return DisplayableObject.ObjectWidth.Eight;
     //}
     return(DisplayableObject.ObjectWidth.Thin);
 }