CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

GetCellClass 方法 (ActiveX)

2024-5-18 17:51| 发布者: admin| 查看: 57| 评论: 0|原作者: admin|来自: AutoCAD

GetCellClass 方法 (ActiveX)

获取单元格样式的类。

支持的平台:仅限 Windows

签名

VBA:

RetVal = object.GetCellClass(StringCellStyle)
对象

类型:TableStyle

此方法应用到的对象。

StringCellStyle

访问:仅输入

类型:字符串

表单元格样式名称。

返回值 (RetVal)

类型:整数

单元格样式类。

言论

没有其他评论。

例子

VBA:

Sub Example_CellClass()
    ' This example creates a TableStyle object and sets values for
    ' the style classes and formatting.
    
    Dim dictionaries As AcadDictionaries
    Set dictionaries = ThisDrawing.Database.dictionaries
  
    Dim dictObj As AcadDictionary
    Set dictObj = dictionaries.Item("acad_tablestyle")
  
    ' Create the custom TableStyle object in the dictionary
    Dim keyName As String
    Dim className As String
    Dim customObj As IAcadTableStyle
    keyName = "NewStyle"
    className = "AcDbTableStyle"
    Set customObj = dictObj.AddObject(keyName, className)
      
    customObj.Name = "NewStyle"
    customObj.Description = "New Style for My Tables"
  
    customObj.CreateCellStyle ("NewTestStyle")
    Dim cellTestFormat As String
      
    customObj.SetCellClass "NewTestStyle", 4
      
    customObj.SetRotation "NewTestStyle", 8.4
      
    MsgBox "The cell class is " & customObj.GetCellClass("NewTestStyle") & _
           " the cell rotation is " & customObj.GetRotation("NewTestStyle")
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_CellClass()
    ;; This example creates a TableStyle object and sets values for
    ;; the style classes and formatting.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    (setq dictionaries (vla-get-Dictionaries doc))
  
    (setq dictObj (vla-Item dictionaries "acad_tablestyle"))
  
    ;; Create the custom TableStyle object in the dictionary
    (setq keyName "NewStyle"
          className "AcDbTableStyle")
    (setq customObj (vla-AddObject dictObj keyName className))
      
    (vla-put-Name customObj "NewStyle")
    (vla-put-Description customObj "New Style for My Tables")
  
    (vla-CreateCellStyle customObj "NewTestStyle")

    (vla-SetCellClass customObj "NewTestStyle" 4)
    (vla-SetRotation customObj "NewTestStyle" 8.4)
      
    (alert (strcat "The cell class is " (itoa (vla-GetCellClass customObj "NewTestStyle"))
                   " and the cell rotation is " (rtos (vla-GetRotation customObj "NewTestStyle") 2) "."
           )
    )
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 11:37

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部