创建容差图元。 支持的平台:仅窗口 签名工 务 局: RetVal = object.AddTolerance(Text, InsertionPoint, Direction) 言论没有额外的评论。 例子工 务 局: Sub Example_AddTolerance() ' This example creates a tolerance object in model space. Dim toleranceObj As AcadTolerance Dim textString As String Dim insertionPoint(0 To 2) As Double Dim direction(0 To 2) As Double ' Define the tolerance object textString = "{\Fgdt;r}%%vasdf{\Fgdt;l}%%vdf%%vxc%%v12{\Fgdt;m}%%vsd" & vbCrLf & _ "{\Fgdt;t}%%vdfd%%v3dd{\Fgdt;l}%%vv%%v%%vxc{\Fgdt;m}" & vbCrLf & _ "123" insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0# direction(0) = 1#: direction(1) = 1#: direction(2) = 0# ' Create the tolerance object in model space Set toleranceObj = ThisDrawing.ModelSpace.AddTolerance(textString, insertionPoint, direction) ZoomAll End Sub Visual LISP: (vl-load-com) (defun c:Example_AddTolerance() ;; This example creates a tolerance object in model space. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the tolerance object (setq insertionPoint (vlax-3d-point 5 5 0) direction (vlax-3d-point 1 0 0)) (setq textString (strcat "{\\Fgdt;r}%%vasdf{\\Fgdt;l}%%vdf%%vxc%%v12{\\Fgdt;m}%%vsd\n" "{\\Fgdt;t}%%vdfd%%v3dd{\\Fgdt;l}%%vv%%v%%vxc{\\Fgdt;m}\n" "123" ) ) ;; Create the tolerance object in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq toleranceObj (vla-AddTolerance modelSpace textString insertionPoint direction)) (vla-ZoomAll acadObj) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-23 16:13
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.