ddbegg 发表于 2016-8-3 15:12:41

cad 2016 下TABLE需“删除所有特性替代"

请问大神,我想对选中的CAD TABLE进行字高和对齐方式的调整,下面的代码在2006下能运行,但在2016下需要先“删除所有特性替代”,才能按下面的代码调整

请帮忙看下,如何能解决CAD2016下不用手动去“删除所有特性替代”,直接运行代码,可达到我想要的效果


(defun c:xxx()
(setq ss nil)
(while (= ss nil)
(setq ss (ssget '((0 . "ACAD_TABLE"))))
)
(setq tb (vlax-ename->vla-object (ssname ss 0)))
(vla-settextheight tb acDataRow 1.5)
(vla-setalignment tb acDataRow acMiddleCenter)





kozmosovia 发表于 2016-8-3 15:55:31

需要编写程序先把所有单元格内的格式设定全部去除。
可以尝试使用http://bimarch.cn/kozmoshelp/tablexpress/tablexpresshelp.html中的TEXPSTRIP命令将表格轻量化,然后再使用你的代码。

ddbegg 发表于 2016-8-3 17:33:12

kozmosovia 发表于 2016-8-3 15:55 static/image/common/back.gif
需要编写程序先把所有单元格内的格式设定全部去除。
可以尝试使用http://bimarch.cn/kozmoshelp/tablexpre ...
可否稍微指点一下如何删除所有特性替代? 我试了下应该和删除单元格文字格式效果不一样吧?

kozmosovia 发表于 2016-8-3 18:36:20

试一下这个
ClearTableStyleOverrides Method (ActiveX)

Clears table style overrides.

Supported platforms: Windows only

Signature
VBA:

object.ClearTableStyleOverrides flag
object
Type: Table

The object this method applies to.

flag
Access: Input-only

Type: Long; one of three integer values

0: Deletes all table and cell overrides.
1: Deletes all table overrides, but retains cell overrides.
2: Deletes all cell overrides, but retains table overrides.

kozmosovia 发表于 2016-8-3 18:38:20

RemoveAllOverrides Method (ActiveX)

Removes all the overrides for a cell.

Supported platforms: Windows only

Signature
VBA:

object.RemoveAllOverrides nRow, nCol
object
Type: Table

The object this method applies to.

nRow
Access: Input-only

Type: Integer

The row number of the cell to set.

nCol
Access: Input-only

Type: Integer

The column number of the cell to set.
页: [1]
查看完整版本: cad 2016 下TABLE需“删除所有特性替代"