指定移动文本时如何绘制尺寸文本。 支持的平台:仅窗口 属性值只读:不 类型:枚举acDimTextMovement
言论此属性的初始值为。acMoveTextNoLeader 注意:此属性将覆盖给定维度的 DIMTMOVE 系统变量的值。
例子工 务 局: Sub Example_TextMovement() ' This example creates two aligned dimensions in model space and ' sets the TextMovement property of each one differently to allow ' the user to see the differences this property makes when moving ' dimension text ' ' To see the effects of this property: ' 1) Run this sample ' 2) Enter the drawing and move the dimension text of the leftmost object ' on the screen with the mouse or keyboard. ' 3) Notice the position of the dimension lines ' 4) Repeat with the rightmost object Dim dimObj1 As AcadDimAligned, dimObj2 As AcadDimAligned Dim point1(0 To 2) As Double, point2(0 To 2) As Double Dim point3(0 To 2) As Double, point4(0 To 2) As Double Dim location1(0 To 2) As Double, location2(0 To 2) As Double ' Define the two dimensions point1(0) = 5: point1(1) = 5: point1(2) = 0 point2(0) = 6: point2(1) = 5: point2(2) = 0 location1(0) = 5: location1(1) = 7: location1(2) = 0 point3(0) = 7: point3(1) = 5: point3(2) = 0 point4(0) = 8: point4(1) = 5: point4(2) = 0 location2(0) = 5: location2(1) = 7: location2(2) = 0 ' Create the aligned dimension objects in model space Set dimObj1 = ThisDrawing.ModelSpace.AddDimAligned(point1, point2, location1) Set dimObj2 = ThisDrawing.ModelSpace.AddDimAligned(point3, point4, location2) ThisDrawing.Application.ZoomAll ' Set the text movement of the new dimensions to different values dimObj1.TextMovement = acMoveTextNoLeader location1(0) = 5.5: location1(1) = 7.5: location1(2) = 0 dimObj1.TextPosition = location1 dimObj2.TextMovement = acDimLineWithText location2(0) = 7.5: location2(1) = 7.5: location2(2) = 0 dimObj2.TextPosition = location2 End Sub Visual LISP: (vl-load-com) (defun c:Example_TextMovement() ;; This example creates two aligned dimensions in model space and ;; sets the TextMovement property of each one differently to allow ;; the user to see the differences this property makes when moving ;; dimension text ;; ;; To see the effects of this property: ;; 1) Run this sample ;; 2) Enter the drawing and move the dimension text of the leftmost object ;; on the screen with the mouse or keyboard. ;; 3) Notice the position of the dimension lines ;; 4) Repeat with the rightmost object (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the two dimensions (setq point1 (vlax-3d-point 5 5 0) point2 (vlax-3d-point 6 5 0) location1 (vlax-3d-point 5 7 0)) (setq point3 (vlax-3d-point 7 5 0) point4 (vlax-3d-point 8 5 0) location2 (vlax-3d-point 5 7 0)) ;; Create the aligned dimension objects in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq dimObj1 (vla-AddDimAligned modelSpace point1 point2 location1)) (setq dimObj2 (vla-AddDimAligned modelSpace point3 point4 location2)) (vla-ZoomAll acadObj) ;; Set the text movement of the new dimensions to different values (vla-put-TextMovement dimObj1 acMoveTextNoLeader) (setq location1 (vlax-3d-point 5.5 7.5 0)) (vla-put-TextPosition dimObj1 location1) (vla-put-TextMovement dimObj2 acDimLineWithText) (setq location2 (vlax-3d-point 7.5 7.5 0)) (vla-put-TextPosition dimObj2 location2) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:46
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.