马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 st788796 于 2017-7-10 09:12 编辑
AddMleader 定义如下:
Signature
RetVal = object.AddMLeader(pointsArray, leaderLineIndex)
pointsArray Variant (three-element array of Doubles); input-only
The array of 3D WCS coordinates specifying the leader. You must provide at least two point to define the leader. The third point is optional. leaderLineIndex
Long; input-only
Input index of the mleader cluster. RetVal MLeader object
The newly created MLeader object.
MLeader 是 Leader 增加了"反应器“的集合,Leader 定义如下
Signature RetVal = object.AddLeader(PointsArray, Annotation, Type) Object PointsArray Variant (array of doubles); input-only
The array of 3D WCS coordinates specifying the leader. You must provide at least two points to define the leader. The third point is optional. Annotation Type AcLeaderType enum; input-only acAttributeModeLockPosition acAttributeModeMultipleLine acLineNoArrow acLineWithArrow acSplineNoArrow acSplineWithArrow RetVal Leader object
The newly created Leader object.
其中有个 coordinate 属性,
Signature object.Coordinate(index) object Coordinate Variant (three-element or two-element array of doubles); read-write
The array of X, Y, and Z coordinates for the specified vertex.
LightweightPolyline object: The variant has two elements representing the X and Y coordinates in OCS.
Polyline object: The variant has three elements, representing the X and Y coordinates in OCS. The Z coordinate is present in the variant but ignored.
All other objects: The variant has three elements, representing the X and Y coordinates in WCS; the Z coordinate will default to 0 on the active UCS. Index Integer
The index in the array of vertices for the vertex you want to set or query. The vertex arrays are 0 based. Remarks This property will replace any existing vertices for the specified object. Use standard array-handling techniques to process the values contained in this property. 3DPolyline, Polyline, PolygonMesh: For simple polylines (not splined or curve fit), this property specifies simple vertices. For splined or curve-fit polylines, this property specifies control point vertices. The OCS coordinates for the Polyline and LightweightPolyline objects can be converted to and from other coordinate systems using the TranslateCoordinates method.
- [/align][align=left](defun c:tt (/ ms p p1 ml scl)
- ;;(setq scl (getreal "\nscalefactor: "))
- ;;(if (not scl)
- ;; (setq scl 100.0)
- ;;)
- (setq ms (vla-get-modelspace
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (while (and (setq p (getpoint "\nlocation: "))
- (setq p1 (getpoint p "\nposition: "))
- )
- (princ "\n")
- (princ (trans p 1 0))
- (princ "\n")
- (princ (trans p1 1 0))
- (setq ml (vla-addmleader
- ms
- (vlax-make-variant
- (vlax-safearray-fill
- (vlax-make-safearray
- vlax-vbdouble
- '(0 . 5)
- )
- (append (trans p 1 0)
- (trans p1 1 0)
- )
- )
- )
- 0
- )
- )
- (vla-put-textstring
- ml
- (strcat "X="
- (rtos (car p) 2 0)
- "\\PY="
- (rtos (cadr p) 2 0)
- "\\PZ="
- (rtos (last p) 2 0)
- )
- )
- (vla-put-textjustify ml acAttachmentPointMiddleLeft)
- (vla-put-textleftattachmenttype ml 3)
- (vla-put-textrightattachmenttype ml 3)
- (vla-put-DoglegLength ml 10.0)
- (vla-put-scalefactor ml 50)
- )
- (princ)
- )
|