明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 604|回复: 4

[已解答] cad 2016 下TABLE需“删除所有特性替代"

[复制链接]
发表于 2016-8-3 15:12 | 显示全部楼层 |阅读模式
请问大神,我想对选中的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)





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2016-8-3 15:55 | 显示全部楼层
需要编写程序先把所有单元格内的格式设定全部去除。
可以尝试使用http://bimarch.cn/kozmoshelp/tablexpress/tablexpresshelp.html中的TEXPSTRIP命令将表格轻量化,然后再使用你的代码。
 楼主| 发表于 2016-8-3 17:33 | 显示全部楼层
kozmosovia 发表于 2016-8-3 15:55
需要编写程序先把所有单元格内的格式设定全部去除。
可以尝试使用http://bimarch.cn/kozmoshelp/tablexpre ...

可否稍微指点一下如何删除所有特性替代? 我试了下应该和删除单元格文字格式效果不一样吧?
发表于 2016-8-3 18:36 | 显示全部楼层
试一下这个
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.

评分

参与人数 1金钱 +5 收起 理由
ddbegg + 5

查看全部评分

发表于 2016-8-3 18:38 | 显示全部楼层
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.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-18 17:45 , Processed in 0.275424 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表