CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

SetInvisibleEdge Method (ActiveX)

2023-1-4 01:50| 发布者: admin| 查看: 396| 评论: 0|来自: AutoCAD

摘要: 设置边在给定索引处的可见性状态。

设置边在给定索引处的可见性状态。

支持的平台:仅窗口

签名

工 务 局:

object.SetInvisibleEdge Index, State
对象

类型:3DFace

此方法适用的对象。

指数

访问:仅输入

类型:

指定要设置的边的索引。索引必须介于 0 和 3 之间(含 0 和 3)。

访问:仅输入

类型:布尔

  • True:将边缘设置为不可见。
  • False:将边缘设置为可见。

返回值(RetVal)

无返回值。

言论

您可以创建所有边都不可见的对象。它不会出现在线框演示文稿中,但可以隐藏线条图中的材料。它不会出现在着色渲染中。3DFace

必须调用该方法才能在图形中显示任何可见性更改。Regen

例子

工 务 局:

Sub Example_SetInvisibleEdge()
    ' This example creates a 3D face in model space.
    ' It then toggles the visibility of the  first edge.

    Dim faceObj As Acad3DFace
    Dim point1(0 To 2) As Double
    Dim point2(0 To 2) As Double
    Dim point3(0 To 2) As Double
    Dim point4(0 To 2) As Double
    
    ' Define the four coordinates of the face
    point1(0) = 1#: point1(1) = 1#: point1(2) = 0#
    point2(0) = 5#: point2(1) = 1#: point2(2) = 1#
    point3(0) = 1#: point3(1) = 10#: point3(2) = 0#
    point4(0) = 5#: point4(1) = 5#: point4(2) = 1#
    
    ' Create the 3DFace object in model space
    Set faceObj = ThisDrawing.ModelSpace.Add3DFace(point1, point2, point3, point4)
    ZoomAll
    
    ' Find the current visibility status of the first edge of the face
    Dim visStatus As Boolean
    visStatus = faceObj.GetInvisibleEdge(0)
    MsgBox "The first face is currently " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"
    
    ' Toggle the visibility of the first edge of the face
    faceObj.SetInvisibleEdge 0, Not (visStatus)
    ThisDrawing.Regen False
    MsgBox "The first face is now " & IIf(faceObj.GetInvisibleEdge(0), "visible.", "invisible."), , "GetInvisibleEdge Example"
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_SetInvisibleEdge()
    ;; This example creates a 3D face in model space.
    ;; It then toggles the visibility of the  first edge.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define the four coordinates of the face
    (setq point1 (vlax-3d-point 1 1 0)
          point2 (vlax-3d-point 5 1 1)
          point3 (vlax-3d-point 5 5 1)
          point4 (vlax-3d-point 1 10 0))
    
    ;; Create the 3DFace object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq faceObj (vla-Add3DFace modelSpace point1 point2 point3 point4))
    (vla-ZoomAll acadObj)
    
    ;; Find the current visibility status of the first edge of the face
    (setq visStatus (vla-GetInvisibleEdge faceObj 0))
    (alert (strcat "The first face is currently " (if (= visStatus :vlax-true) "visible." "invisible.")))
    
    ;; Toggle the visibility of the first edge of the face
    (vla-SetInvisibleEdge faceObj 0 (if (= visStatus :vlax-true) :vlax-false :vlax-true))
    (vla-Regen doc :vlax-false)
    (alert (strcat "The first face is now " (if (= (vla-GetInvisibleEdge faceObj 0) :vlax-true) "visible." "invisible.")))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 16:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部