乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 66|回复: 9

[编程交流] 文档vla对象到au

[复制链接]

14

主题

76

帖子

63

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:39:15 | 显示全部楼层 |阅读模式
我想知道是否有处理autoCADtables的文档。
有几个线程展示了如何使用AddTable方法创建一个表,以及其他如何创建一个表样式的教学,但没有发现任何关于哪些属性可以更改的内容,等等。
说明表支持哪些方法和属性以及如何配置这些方法和属性的文档。
可以使用由Lee Mac创建的转储工具进行分析,在Autocadable中有许多东西需要配置。
有人知道吗?
能告诉我怎么走吗?
我发誓,我在网上扫了一眼,没有找到。
 
非常感谢你。
 
祝你好运,路易斯·奥古斯托。
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 23:52:36 | 显示全部楼层
我发现这很容易,你也可以改变一个细胞,像文字高度颜色等东西。
 
  1. ; example of creating a table style
  2. (vl-load-com)
  3. (defun c:CreateTableStyle()
  4.    ;; Get the AutoCAD application and current document
  5.    (setq acad (vlax-get-acad-object))
  6.    (setq doc (vla-get-ActiveDocument acad))
  7.    ;; Get the Dictionaries collection and the TableStyle dictionary
  8.    (setq dicts (vla-get-Dictionaries doc))
  9.    (setq dictObj (vla-Item dicts "acad_tablestyle"))
  10.    
  11.    ;; Create a custom table style
  12.    (setq key "MyTableStyle"
  13.          class "AcDbTableStyle")
  14.    (setq custObj (vla-AddObject dictObj key class))
  15.    ;; Set the name and description for the style
  16.    (vla-put-Name custObj "MyTableStyle")
  17.    (vla-put-Description custObj "This is my custom table style")
  18.    ;; Sets the bit flag value for the style
  19.    (vla-put-BitFlags custObj 1)
  20.    ;; Sets the direction of the table, top to bottom or bottom to top
  21.    (vla-put-FlowDirection custObj acTableTopToBottom)
  22.    ;; Sets the supression of the table header
  23.    (vla-put-HeaderSuppressed custObj :vlax-false)
  24.    ;; Sets the horizontal margin for the table cells
  25.    (vla-put-HorzCellMargin custObj 0.22)
  26.    ;; Sets the supression of the table title
  27.    (vla-put-TitleSuppressed custObj :vlax-false)
  28.    ;; Sets the vertical margin for the table cells
  29.    (vla-put-VertCellMargin custObj 0.22)
  30.    ;; Set the alignment for the Data, Header, and Title rows
  31.    (vla-SetAlignment custObj (+ acDataRow acTitleRow) acMiddleLeft)
  32.    (vla-SetAlignment custObj acHeaderRow acMiddleCenter)
  33.    ;; Set the background color for the Header and Title rows
  34.    (setq colObj (vlax-create-object "AutoCAD.AcCmColor.19"))
  35.    (vla-SetRGB colObj 98 136 213)
  36.    (vla-SetBackgroundColor custObj (+ acHeaderRow acTitleRow) colObj)
  37.    ;; Clear the background color for the Data rows
  38.    (vla-SetBackgroundColorNone custObj acDataRow :vlax-true)
  39.    ;; Set the bottom grid color for the Title row
  40.    (vla-SetRGB colObj 0 0 255)
  41.    (vla-SetGridColor custObj acHorzBottom acTitleRow colObj)
  42.    ;; Set the bottom grid lineweight for the Title row
  43.    (vla-SetGridLineWeight tableStyle acHorzBottom acTitleRow acLnWt025)
  44.    ;; Set the inside grid lines visible for the data and header rows
  45.    (vla-SetGridVisibility custObj acHorzInside  (+ acDataRow acHeaderRow) :vlax-true)
  46.    ;; Set the text height for the Title, Header and Data rows
  47.    (vla-SetTextHeight custObj acTitleRow 1.5)
  48.    (vla-SetTextHeight custObj (+ acDataRow acHeaderRow) 1.0)
  49.    ;; Set the text height and style for the Title row
  50.    (vla-SetTextStyle custObj (+ acDataRow acHeaderRow acTitleRow) "Standard")
  51.    ;; Release the color object
  52.    (vlax-release-object colObj)
  53. (princ)
  54. )
回复

使用道具 举报

14

主题

76

帖子

63

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:57:27 | 显示全部楼层
尊敬的Bigal,感谢您的回复。
你在这里找到了这个代码?
密码
 
我觉得有必要了解它,只是想改变这个程序。我正在创建错误处理,这意味着如果图形中不存在表格样式。
 
我可能错了,但没有看到在哪里修改列的数量和宽度。细胞也是如此。
如果这是清楚的,请对我有耐心,因为我只是一个初学者。
 
我必须创建的表格样式非常简单,如果我发布了,肯定会有人帮我。让我困惑的是,这样的文档似乎并不存在!
 
我很感激你能帮助我。如果你知道如何为每一个列设置数量和大小,我将非常感激。
 
感谢您分享您的知识。
 
你好,路易斯·奥古斯托。
回复

使用道具 举报

6

主题

62

帖子

57

银币

初来乍到

Rank: 1

铜币
30
发表于 2022-7-6 00:01:55 | 显示全部楼层
你好
 
关于这个问题,有一些非盟的说明可能会有所帮助。
 
在此处尝试http://forums.augi.com/showthread.php?148682-CP34-3-LISP-Table-Magic
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:09:32 | 显示全部楼层
现在不在工作,做表格大小很容易,明天会发帖子,我很容易找到如何创建表格的例子。这花了几秒钟的时间,VLA创建表格AutoCAD有很多例子
回复

使用道具 举报

14

主题

76

帖子

63

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 00:12:56 | 显示全部楼层
 
很棒的材料Spaj。欢迎评论代码。
实际上很有启发性,但我觉得它缺少了一些需要操作的属性,还是我错了?
 
非常感谢分享。
 
 
我期待着你的职位。
谢谢比格尔。
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:25:15 | 显示全部楼层
这个例子是从更大的代码中截取的。但有必要的部分
 
  1. (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  2. (setq curspace (vla-get-paperspace doc)) ; must be in paper space which layout to put table in change to modelspace if required.
  3. (setq pt1 (vlax-3d-point (getpoint "\nPick point for top left hand of table:  ")))
  4. ; now do table
  5. (setq numrows (+ 2 (sslength ss1))) ; ss1 is a list of data for table
  6. (setq numcolumns 2)
  7. (setq rowheight 0.2)
  8. (setq colwidth 150)
  9. (setq objtable (vla-addtable curspace pt1 numrows numcolumns rowheight colwidth))
  10. (vla-settext objtable 0 0 "DRAWING REGISTER")
  11. (vla-settext objtable 1 0 "DRAWING NUMBER")
  12. (vla-settext objtable 1 1 "DRAWING TITLE")
  13. (SETQ X 0)
  14. (SETQ Y 2)
  15. (REPEAT (sslength ss1)
  16. (vla-settext objtable Y 0 (NTH X LIST1))
  17. (vla-settext objtable Y 1 (NTH X LIST2))
  18. (vla-setrowheight objtable y 10)
  19. (SETQ X (+ X 1))
  20. (SETQ Y (+ Y 1))
  21. )
回复

使用道具 举报

14

主题

76

帖子

63

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-6 00:26:06 | 显示全部楼层
 
比格尔,谢谢你的贡献。
我希望这个帖子能帮助别人,也能帮助我。
 
谢谢大家。
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 00:33:19 | 显示全部楼层
别担心
回复

使用道具 举报

51

主题

481

帖子

457

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
262
发表于 2022-7-6 00:40:24 | 显示全部楼层
查找附件
LISPTableMagicUpload2。拉链
au06_Table_Magic。拉链
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 00:23 , Processed in 0.464859 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表