马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 st788796 于 2015-11-9 09:58 编辑
Hatch 是经常用的一种实体类型,在 ObjectARX 中 AcDbHatch 的默认构造 是
AcDbHatch* pHatch = new AcdbHatch();
可以看到这里没有**任何 Hatch 特殊属性,要生成显示的 Hatch 实体,还需要对这个 pHatch 进行一些列的 设置,比如样式类型、角度、填充比例等等,最后不可或缺一步就是要加上“边界”(appendLoop) ,这样这个 Hatch 才有可能成功的创建。
而且,这些边界不一定是真实存在的,在命令中创建完 Hatch ,即使删掉这些边界实体,Hatch 依然可以存在。这些边界信息在 DXF 中 “边界路径数据” 可以查看边界信息,在 ObjectARX 模型中这些边界是 AcGeCurve。
通过上面信息可以知道 Entmake 如果仅用 Hatch 头信息而没有 边界信息 是不能制造出 Hatch 的。在不用 ARX 时可以用 ActiveX 方法制作 Hatch
RetVal = object.AddHatch(PatternType, PatternName, Associativity [, HatchObjectType])
要加入Hatch实体的Object,包括 模型空间、图纸空间、块定义. PatternType 图案类型,枚举类型 input-only AcPatternType or AcGradientPatternType enum;
If the HatchObjectType enum value is acHatchObject, then use the AcPatternType enum; if the HatchObjectType enum value is AcGradientObject, then use the AcGradientPatternType enum.
PatternName 图案名称,字符串 input-only
If the HatchObjectType enum value is acHatchObject, then PatternName should contain the hatch pattern name. If the HatchObjectType enum value is acGradientObject, then PatternName should contain one of the the gradient pattern names listed in GradientName.
Associativity 关联选项,布尔值; input-only TRUE: The hatch will be associative. FALSE: The hatch will not be associative.
HatchObjectType 填充实体类型, 可选项 ; input-only
The default value is the AcHatchObjectType enum value of AcHatchObject. If the AcHatchObjectType enum value is AcGradientObject, then PatternType should be of type AcGradientPatternType, and PatternName should contain the gradient pattern name.
返回值 Hatch object
The newly created Hatch object.
说明:
The PatternType constant values are as follows:
acHatchPatternTypePredefined Selects the pattern name from those defined in the acad.pat file. acHatchPatternTypeUserDefined Defines a pattern of lines using the current linetype. acHatchPatternTypeCustomDefined Selects the pattern name from a PAT file other than the acad.pat file.
After the Hatch object is created, you must add the outer loop using the AppendOuterLoop method.
Hatch创建后,你必须对Hatch使用 AppendOuterLoop 方法增加外部边界
The outer loop must be closed and must be created before any inner loops can be created.
外部边界必须在内部环创建前创建
Inner loops are created one at a time, using the AppendInnerLoop method.
内部环使用 AppendInnerLoop 一次创建
WARNING! Once the Hatch object has been created, you must append the outer loop to the Hatch object for it to become a valid AutoCAD object. 警告!Hatch 一旦创建,你必须增加外部环,以使 Hatch 成为 AutoCAD 有效实体 If you attempt any operation other than calling the AppendOuterLoop method, AutoCAD will enter an unpredictable state. 如果你在使用 AppendOuterLoop 方法之前试图其它任何操作,AutoCAD将进入不可预测状态
待续
|