CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

Clipped 属性 (ActiveX)

2024-5-18 19:08| 发布者: admin| 查看: 130| 评论: 0|原作者: admin|来自: AutoCAD

Clipped 属性 (ActiveX)

确定视口是否已被剪裁。

支持的平台:仅限 Windows

签名

VBA:

object.Clipped
对象

类型: PViewport

此属性应用于的对象。

属性值

只读:是的

类型:布尔

  • True:视口已被裁剪。
  • False:视口尚未被裁剪。

言论

没有其他评论。

例子

VBA:

Sub Example_Clipped()
    ' This example scans the current drawing paper space Viewports
    ' and displays whether or not any of them are clipped.
    
    Dim pviewportObj As Object
    Dim msg As String, ClippedState As String
    
    ' Make sure this drawing contains paper space viewports before continuing
    If ThisDrawing.PaperSpace.Count = 0 Then
        MsgBox "There are no paper space viewports in the current drawing."
        Exit Sub
    End If
    
    ' Go through each PViewport object in the drawing paper space
    ' and determine whether the paper space viewport is clipped or not

    For Each pviewportObj In ThisDrawing.PaperSpace
        ' Determine if this is a paper space viewport
        If pviewportObj.ObjectName = "AcDbViewport" Then
            ' Determine if this paper space viewport is clipped
            ClippedState = IIf(pviewportObj.Clipped, " is clipped", " is not clipped")
            msg = msg & "PViewport ID " & pviewportObj.ObjectID & ClippedState & vbCrLf
        End If
    Next

    ' Display clipped state of paper space Viewports
    MsgBox msg
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_Clipped()
    ;; This example scans the current drawing paper space Viewports
    ;; and displays whether or not any of them are clipped.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Make sure this drawing contains paper space viewports before continuing
    (if (= (vla-get-Count (vla-get-PaperSpace doc)) 0)
        (alert "There are no paper space viewports in the current drawing.")
        (progn
	    ;; Go through each PViewport object in the drawing paper space
	    ;; and determine whether the paper space viewport is clipped or not
    	    (setq msg "")
    
	    (vlax-for pviewportObj (vla-get-PaperSpace doc)
	        ;; Determine if this is a paper space viewport
	        (if (= (vla-get-ObjectName pviewportObj) "AcDbViewport")
	            (progn
	                ;; Determine if this paper space viewport is clipped
	                (setq ClippedState (if (= (vla-get-Clipped pviewportObj) :vlax-true) " is clipped" " is not clipped"))
	                (setq msg (strcat msg "PViewport ID " (itoa (vla-get-ObjectID pviewportObj)) ClippedState "\n"))
		    )
	        )
	    )

	    ;; Display clipped state of paper space Viewports
	    (alert msg)
	)
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1   苏公网安备32011402011833)

GMT+8, 2024-12-15 22:13

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部