AddTolerance 方法 (ActiveX)
创建公差图元。 支持的平台:仅限 Windows 签名VBA: RetVal = object.AddTolerance(Text, InsertionPoint, Direction) 言论没有其他评论。 例子VBA: 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 可视化 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, 2024-12-15 12:54
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.