CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

SetCellDataType Method (ActiveX)

2023-1-4 03:08| 发布者: admin| 查看: 621| 评论: 0|来自: AutoCAD

摘要: 设置给定行和列的单元格数据和单位类型。

设置给定行和列的单元格数据和单位类型。

支持的平台:仅窗口

签名

工 务 局:

object.SetCellDataType row, col, dataType, unitType
对象

类型:桌子

此方法适用的对象。

访问:仅输入

类型:

要设置的单元格的行号。

山坳

访问:仅输入

类型:

要设置的单元格的列号。

p数据类型

访问:仅输入

类型:枚举AcValueDataType

新的单元格数据类型。

  • acBuffer
  • acDate
  • acDouble
  • acGeneral
  • acLong
  • acObjectId
  • acPoint2d
  • acPoint3d
  • acResbuf
  • acString
  • acUnknownDataType
pUnitType

访问:仅输入

类型:枚举AcValueUnitType

新的单元单元类型。

  • acUnitAngle
  • acUnitArea
  • acUnitDistance
  • acUnitless
  • acUnitVolume

返回值(RetVal)

无返回值。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_CellManipulation()
    ' This example adds a table in model space and sets and gets a column name

    Dim MyModelSpace As AcadModelSpace
    Set MyModelSpace = ThisDrawing.modelSpace
    Dim pt(2) As Double
    Dim MyTable As AcadTable
    Dim cName As String
    Set MyTable = MyModelSpace.AddTable(pt, 5, 5, 10, 30)
    
    Call MyTable.SetCellDataType(2, 2, acLong, acUnitDistance)
    Call MyTable.SetCellFormat(1, 3, "testFormat")
    Call MyTable.SetCellState(4, 3, acCellStateContentLocked)
    Call MyTable.SetCellValue(1, 4, 5)
    
    MsgBox MyTable.GetCellValue(1, 4) & " is the test cell's value "

    ZoomExtents
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_CellManipulation()
    ;; This example adds a table in model space and sets and gets a column name
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq pt (vlax-3d-point 0 0 0))
  
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq MyTable (vla-AddTable modelSpace pt 5 5 10 30))
    
    (vla-SetCellDataType MyTable 2 2 acLong acUnitDistance)
    (vla-SetCellFormat MyTable 1 3 "testFormat")
    (vla-SetCellState MyTable 4 3 acCellStateContentLocked)
    (vla-SetCellValue MyTable 1 4 5)
    
    (alert (strcat (itoa (vlax-variant-value (vla-GetCellValue MyTable 1 4))) " is the test cell's value."))

    (vla-ZoomExtents acadObj)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 14:25

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部