初学UG/NX, 对体的各种tag还不熟悉,更别说各种面、边、点的操作,感觉就像一口锅里面的饺子,根本分不清哪个是哪个。
所以,这里对体的面、边、点以及各对象进行了一次整理,废话不说,直接上代码:
1、先定义体、面、边模型
using NXOpen;
using NXOpen.Assemblies;
using NXOpen.Facet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
namespace Auto_Init.Model
{
/// <summary>
/// 基本属性
/// </summary>
public class Base
{
public string StrTag { get; set; } //返回对象的tag
public Tag Tag { get; set; }
public int Layer { get; set; } //返回当前对象所在层
public bool IsOccurrence { get; set; } //返回此对象是否为实例
public bool IsBlanked { get; set; } //返回此对象是否为空白状态
public string Name { get; set; } //Returns the custom name of the object.
public Point3d NameLocation { get; set; } //Returns the location of the object's name. (可能是中心点坐标)
public string JournalIdentifier { get; set; } //返回此对象的日志中的标识符
public int Color { get; set; } //返回颜色
public DisplayableObject.ObjectFont LineFont { get; set; } //Returns or sets the line font of the object
public DisplayableObject.ObjectWidth LineWidth { get; set; } //Returns or sets the line width of the object.
public Component OwningComponent { get; set; } //如果此对象是引用,则返回所属组件
public BasePart OwningPart { get; set; } //Returns the owning part of this object
public INXObject Prototype { get; set; } //Returns the prototype of this object if it is an occurrence.
}
/// <summary>
/// 块/体
/// </summary>
public class BodyModel : Base
{
public List<FaceModel> FaceList { get; set; }
public FaceFlag faceFlag { get; set; }
public double Density { get; set; } //密度
public bool IsSheetBody { get; set; } //是否为sheet
public bool IsSolidBody { get; set; } //是否为实体
public IMessageSink NextSink { get; set; } //Gets the next message sink in the sink chain.
public Type Type { get; set; } //类型
public FacetedBody facetBody { get; set; } //镶嵌体
public bool upToDate { get; set; } //过期时间
public Dictionary<string, FaceModel> DicFace { get; set; } //面字典,key为面的tag
public Dictionary<string, EdgeModel> DicEdge { get; set; } //边字典,

最低0.47元/天 解锁文章
5184

被折叠的 条评论
为什么被折叠?



