CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

布局ID32属性(ActiveX)

2023-1-2 22:18| 发布者: admin| 查看: 228| 评论: 0|来自: AutoCAD

摘要: 指定 64 位系统的视图布局。(已过时)

指定 64 位系统的视图布局。(已过时)

支持的平台:仅窗口

签名

工 务 局:

object.LayoutID32
对象

类型:视图

此属性适用的对象。

属性值

只读:是的

类型:

布局的对象 ID。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_LayoutID32()
    ' This example demonstrates the
    ' CategoryName, LayoutID32, LayerState,
    ' and HasVpAssociation properties of the View object
    
    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager.20")

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database

    oLSM.Save "ColorLinetype", acLsColor + acLsLineType
    
    ' Create a view named "New_View" in current drawing
    Dim viewObj As AcadView
   
    ' Add the view to the views collection
    Set viewObj = ThisDrawing.Views.Add("New_View")
    MsgBox viewObj.Name & " has been added." & vbCrLf & _
           "Height: " & viewObj.Height & vbCrLf & _
           "Width: " & viewObj.Width, , "Example"
    
    viewObj.CategoryName = "My View Category"
    viewObj.LayerState = "My Layer State"
    
    viewObj.LayoutId32 = ThisDrawing.Layouts(1).ObjectID32
        
    MsgBox viewObj.CategoryName & " is the Category name." & vbCrLf & _
            viewObj.LayoutId32 & " is the Layout ID." & vbCrLf & _
            viewObj.LayerState & " is the Layer state."
   
    If viewObj.HasVpAssociation = True Then
        MsgBox "The view is associated with a paper space viewport."
    Else
        MsgBox "The view is not associated with a paper space viewport."
    
   End If
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_LayoutID32()
    ;; This example demonstrates the
    ;; CategoryName, LayoutId32, LayerState,
    ;; and HasVpAssociation properties of the View object
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Access the LayerStateManager object
    (setq oLSM (vla-GetInterfaceObject acadObj "AutoCAD.AcadLayerStateManager.20"))

    ;; Associate the current drawing database with LayerStateManager
    (vla-SetDatabase oLSM (vla-get-Database doc))

    (vla-Save oLSM "ColorLinetype" (+ acLsColor acLsLineType))
    
    ;; Create a view named "New_View" in current drawing
    ;; Add the view to the views collection
    (setq viewObj (vla-Add (vla-get-Views doc) "New_View"))
    (alert (strcat (vla-get-Name viewObj) " has been added."
                   "\nHeight: " (rtos (vla-get-Height viewObj) 2)
                   "\nWidth: " (rtos (vla-get-Width viewObj) 2)))
    
    (vla-put-CategoryName viewObj "My View Category")
    (vla-put-LayerState viewObj "ColorLinetype")
    
    (vla-put-LayoutId32 viewObj (vla-get-ObjectID32 (vla-Item (vla-get-Layouts doc) 1)))

    (alert (strcat (vla-get-CategoryName viewObj) " is the Category name."
                   "\n" (itoa (vla-get-LayoutId viewObj)) " is the Layout ID."
                   "\n" (vla-get-LayerState viewObj) " is the Layer state."))
  
    (if (= (vla-get-HasVpAssociation viewObj) :vlax-true)
        (alert "The view is associated with a paper space viewport.")
        (alert "The view is not associated with a paper space viewport.")
    )

    (vlax-release-object oLSM)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 01:46

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部