乐筑天下

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

[编程交流] Mlstyle Caps关闭?

[复制链接]

7

主题

37

帖子

30

银币

初来乍到

Rank: 1

铜币
35
发表于 2022-7-6 11:00:57 | 显示全部楼层 |阅读模式
亲爱的朋友们:,
我需要lisp或宏。。。
以标准mlstyle按行关闭封口
如果可能的话,请帮助我。。。。。。。
当做
马尼
120058skkukkdq1egyuke7.jpg
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 11:06:13 | 显示全部楼层
你好
实际上,这些点的实体代码是什么(开始和结束)。
 
君王,
塔瓦特
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:10:24 | 显示全部楼层
 
那你为什么不学着写呢?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:11:42 | 显示全部楼层
 
样式存储在ACAD_MLINESTYLE字典中,cap设置(除其他外)存储在样式字典项的组70中。
 
查找设置了哪些属性的示例:
 
  1. (defun GetMLineStyleProps ( style / dic )
  2. ;; © Lee Mac  ~  10.06.10
  3. (if (and (setq dic (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))
  4.           (setq dic (dictsearch (cdr (assoc -1 dic)) style)))
  5.    (GetBits (cdr (assoc 70 dic)))
  6. )
  7. )
  8. ;; GetBits ~  © Lee Mac
  9. ;; Returns the bit combination of a number
  10. (defun GetBits (n / b)
  11. (if (< 0 n)
  12.    (cons (setq b (expt 2 (fix (/ (log n) (log 2)))))
  13.      (GetBits (- n b))
  14.    )
  15. )
  16. )

 
  1. (GetMLineStyleProps "Standard")
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:16:05 | 显示全部楼层
修改属性的示例。。。
 
  1. ;;;    1 = Fill on
  2. ;;;    2 = Display miters
  3. ;;;   16 = Start square end (line) cap
  4. ;;;   32 = Start inner arcs cap
  5. ;;;   64 = Start round (outer arcs) cap
  6. ;;;  256 = End square (line) cap
  7. ;;;  512 = End inner arcs cap
  8. ;;; 1024 = End round (outer arcs) cap
  9. (defun PutMLineStyleProps ( style code / dic )
  10. ;; © Lee Mac  ~  10.06.10
  11. (if (and (setq dic (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))
  12.           (setq dic (dictsearch (cdr (assoc -1 dic)) style)))
  13.    (entmod
  14.      (subst (cons 70 (boole 7 (cdr (assoc 70 dic)) code))
  15.        (assoc 70 dic)
  16.        dic
  17.      )
  18.    )
  19. )
  20. )
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 11:19:53 | 显示全部楼层
嗨,李先生
您使用的是一种非常高级的编程语言,超过98%的Cadtutor参与者和普通Autolisp程序员都不知道这种语言,因此,请使用普通Autolisp函数使您的宝贵答案更加清晰。
 
关于您的答案和示例,我真的无法处理大部分内容,尽管我已经使用Autolisp大约三年了。
 
我发现70不属于Mlinestyle的开始或结束,如Autocad DXF帮助中所示;
  1. Mline group codes
  2. Group code
  3. Description
  4. 100
  5. Subclass marker (AcDbMline)
  6. 2
  7. String of up to 32 characters. The name of the style used for this mline. An entry for this style must exist in the MLINESTYLE dictionary.
  8. Do not modify this field without also updating the associated entry in the MLINESTYLE dictionary
  9. 340
  10. Pointer-handle/ID of MLINESTYLE object
  11. 40
  12. Scale factor
  13. 70
  14. Justification: 0 = Top; 1 = Zero; 2 = Bottom
  15. 71
  16. Flags (bit-coded values):
  17. 1 = Has at least one vertex (code 72 is greater than 0)
  18. 2 = Closed
  19. 4 = Suppress start caps
  20. 8 = Suppress end caps
  21. 72
  22. Number of vertices

 
非常感谢
塔瓦特
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:22:03 | 显示全部楼层
我不确定您所说的“普通AutoLISP函数”是什么意思。我使用执行任务所需的函数,作为参考,请参阅此处:
 
http://images.autodesk.com/adsk/files/acad_dxf1.pdf
 
第186页
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 11:24:46 | 显示全部楼层
 
没关系。但问题是,为什么我从autocad Help 2010复制autocad时,autocad有不同的DXF代码。
请给我澄清一下。
  1. LWPOLYLINE
  2. ENTITIES Section
  3. MULTILEADER
  4. DXF Reference > ENTITIES Section >
  5. MLINE Expand All
  6. Expand all collapsed sections.
  7. Collapse All
  8. Collapse all expanded sections.
  9. The following group codes apply to mline entities. In addition to the group codes described here, see Common Group Codes for Entities. For information about abbreviations and formatting used in this table, see Formatting Conventions in This Reference.
  10. Mline group codes
  11. Group code
  12. Description
  13. 100
  14. Subclass marker (AcDbMline)
  15. 2
  16. String of up to 32 characters. The name of the style used for this mline. An entry for this style must exist in the MLINESTYLE dictionary.
  17. Do not modify this field without also updating the associated entry in the MLINESTYLE dictionary
  18. 340
  19. Pointer-handle/ID of MLINESTYLE object
  20. 40
  21. Scale factor
  22. 70
  23. Justification: 0 = Top; 1 = Zero; 2 = Bottom
  24. 71
  25. Flags (bit-coded values):
  26. 1 = Has at least one vertex (code 72 is greater than 0)
  27. 2 = Closed
  28. 4 = Suppress start caps
  29. 8 = Suppress end caps
  30. 72
  31. Number of vertices
  32. 73
  33. Number of elements in MLINESTYLE definition
  34. 10
  35. Start point (in WCS)
  36. DXF: X value; APP: 3D point
  37. 20, 30
  38. DXF: Y and Z values of start point (in WCS)
  39. 210
  40. Extrusion direction (optional; default = 0, 0, 1)
  41. DXF: X value; APP: 3D vector
  42. 220, 230
  43. DXF: Y and Z values of extrusion direction (optional)
  44. 11
  45. Vertex coordinates (multiple entries; one entry for each vertex) DXF: X value; APP: 3D point
  46. 21, 31
  47. DXF: Y and Z values of vertex coordinates
  48. 12
  49. Direction vector of segment starting at this vertex (multiple entries; one for each vertex)
  50. DXF: X value; APP: 3D vector
  51. 22, 32
  52. DXF: Y and Z values of direction vector of segment starting at this vertex
  53. 13
  54. Direction vector of miter at this vertex (multiple entries: one for each vertex)
  55. DXF: X value; APP: 3D vector
  56. 23, 33
  57. DXF: Y and Z values of direction vector of miter
  58. 74
  59. Number of parameters for this element (repeats for each element in segment)
  60. 41
  61. Element parameters (repeats based on previous code 74)
  62. 75
  63. Number of area fill parameters for this element (repeats for each element in segment)
  64. 42
  65. Area fill parameters (repeats based on previous code 75)
  66. The group code 41 parameterization is a list of real values, one real per group code 41. The list may contain zero or more items. The first group code 41 value is the distance from the segment vertex along the miter vector to the point where the line element's path intersects the miter vector. The next group code 41 value is the distance along the line element's path from the point defined by the first group 41 to the actual start of the line element. The next is the distance from the start of the line element to the first break (or cut) in the line element. The successive group code 41 values continue to list the start and stop points of the line element in this segment of the mline. Linetypes do not affect group 41 lists.
  67. The group code 42 parameterization is also a list of real values. Similar to the 41 parameterization, it describes the parameterization of the fill area for this mline segment. The values are interpreted identically to the 41 parameters and when taken as a whole for all line elements in the mline segment, they define the boundary of the fill area for the mline segment.
  68. A common example of the use of the group code 42 mechanism is when an unfilled mline crosses over a filled mline and mledit is used to cause the filled mline to appear unfilled in the crossing area. This would result in two group 42s for each line element in the affected mline segment; one for the fill stop and one for the fill start.
  69. The 2 group codes in mline entities and mlinestyle objects are redundant fields. These groups should not be modified under any circumstances, although it is safe to read them and use their values. The correct fields to modify are as follows:
  70. Mline
  71. The 340 group in the same object, which indicates the proper MLINESTYLE object.
  72. Mlinestyle
  73. The 3 group value in the MLINESTYLE dictionary, which precedes the 350 group that has the handle or entity name of the current mlinestyle.
  74. Please send us your comment about this page
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:29:20 | 显示全部楼层
您提供的DXF代码是通过在MLine对象上使用“entget”返回的代码(我假设)。
 
多线样式设置存储在名称对象词典(namedobjdict)中包含的ACAD_多线样式词典对象中。
 
该字典列出了图形中定义的所有MLINESTYLE,因此我们可以在字典中搜索希望检查的样式。
 
我提供的参考资料第186页上列出的DXF代码是样式字典条目的代码。
 
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 11:32:23 | 显示全部楼层
看看我提供的代码——注意,参数不是一个MLine对象,而是一个样式名(字符串)。
 
看看我是如何在我发布的代码中检索DXF代码的。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-6 11:29 , Processed in 0.909576 second(s), 75 queries .

© 2020-2025 乐筑天下

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