乐筑天下

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

[编程交流] 圆角API

[复制链接]

15

主题

30

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
74
发表于 2022-7-6 06:51:42 | 显示全部楼层 |阅读模式
建议您避免在AutoLISP中使用(命令)函数。
 
但是,修剪和圆角/倒角似乎是三项任务,使用(命令)功能是唯一可行的选择。(甚至com方法也不适用于它们)。
 
我想在这里谈谈大家的想法。
回复

使用道具 举报

8

主题

38

帖子

25

银币

初来乍到

Rank: 1

铜币
47
发表于 2022-7-6 07:08:56 | 显示全部楼层
可以使用ActiveX方法编程创建复杂实体。
你可以在我的博客中看到一些例子,特别是关于开发两个新的3DSolid编辑命令:TRIM和SPLIT-inhttp://lispexpert.blogspot.com/p/chapter-18.html
您可以下载这两个命令进行测试。
回复

使用道具 举报

15

主题

30

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
74
发表于 2022-7-6 07:16:59 | 显示全部楼层
复杂固体从哪里来?
 
这是一个简单的问题-除了使用(命令“fillet”…)之外,您还有其他选择吗。
回复

使用道具 举报

8

主题

38

帖子

25

银币

初来乍到

Rank: 1

铜币
47
发表于 2022-7-6 07:27:06 | 显示全部楼层
在二维上下文中使用TRIM的示例程序。。。
加载它,并在命令行中键入GRAPH的一系列行中尝试暗显:
  1. (defun code-value (key ename)
  2. (cdr (assoc key (entget ename)))
  3. ) ;_ end of  defun
  4. ;;;Listing 10.9. Retrieving the value associated with a DXF group code.
  5. (defun ent-text
  6.       (txt-string style pt1 pt2 txt-height h-just v-just)
  7. (entmake (list '(0 . "TEXT")
  8.                 '(100 . "AcDbEntity")
  9.                 '(100 . "AcDbText")
  10.                 (cons 1 txt-string)
  11.                 (cons 7 style)
  12.                 (cons 10 pt1)
  13.                 (cons 11 pt2)
  14.                 (cons 40 txt-height)
  15.                 (cons 72 h-just)
  16.                 (cons 73 v-just)
  17.           ) ;_ end of list
  18. ) ;_ end of entmake
  19. ) ;_ end of defun
  20. ;;;Listing 10.12. Fuction that creates a single line text entity.
  21. (defun endpoint-circle
  22.                       (radius / lines i line-ent pin pfi)
  23. (if (setq lines (ssget "X" '((0 . "LINE"))))
  24.    (progn (setq i 0)
  25.           (while (setq line-ent (ssname lines i))
  26.             (setq pin (code-value 10 line-ent)
  27.                   pfi (code-value 11 line-ent)
  28.             ) ;_ end of setq
  29.             (if (not (member pin drawn))
  30.               (progn (vl-cmdf "._circle" pin radius)
  31.                      (setq drawn (cons pin drawn))
  32.               ) ;_ end of progn
  33.             ) ;_ end of if
  34.             (if (not (member pfi drawn))
  35.               (progn (vl-cmdf "._circle" pfi radius)
  36.                      (setq drawn (cons pfi drawn))
  37.               ) ;_ end of progn
  38.             ) ;_ end of if
  39.             (setq i (1+ i))
  40.           ) ;_ end of while
  41.    ) ;_ end of progn
  42. ) ;_ end of if
  43. ) ;_ end of defun
  44. ;;;Listing 12.2. Function that draws circles at the line endpoints.
  45. (defun trim-line-circle (/ circles lines obj endpoints)
  46. (if (and (setq circles (ssget "X" '((0 . "CIRCLE"))))
  47.           (setq lines (ssget "X" '((0 . "LINE"))))
  48.      ) ;_ end of and
  49.    (progn (setq i 0)
  50.           (while (setq obj (ssname lines i))
  51.             (setq endpoints (cons (code-value 11 obj)
  52.                                   (cons (code-value 10 obj)
  53.                                         endpoints
  54.                                   ) ;_ end of cons
  55.                             ) ;_ end of cons
  56.                   i         (1+ i)
  57.             ) ;_ end of setq
  58.           ) ;_ end of while
  59.           (foreach pt endpoints
  60.             (vl-cmdf "._trim" circles "" pt "")
  61.           ) ;_ end of foreach
  62.           (if (> (getvar "cmdactive") 0)
  63.             (vl-cmdf)
  64.           ) ;_ end of if
  65.    ) ;_ end of progn
  66. ) ;_ end of if
  67. ) ;_ end of defun
  68. ;;;Listing 12.3. Function that demonstrates the use of TRIM from a VLISP function.
  69. (defun number-nodes (pt-lst height / i pt)
  70. (setq pt-lst
  71.         (vl-sort pt-lst
  72.                  '(lambda (pt1 pt2) (> (cadr pt1) (cadr pt2)))
  73.         ) ;_ end of vl-sort
  74. ) ;_ end of setq
  75. (setq i 0)
  76. (while (setq pt (nth i pt-lst))
  77.    (ent-text (itoa (1+ i))
  78.              (getvar "textstyle")
  79.              pt
  80.              pt
  81.              height
  82.              1
  83.              2
  84.    ) ;_ end of ent-text
  85.    (setq i (1+ i))
  86. ) ;_ end of while
  87. ) ;_ end of defun
  88. ;;;Listing 12.4. Graph nodes numbering function.
  89. (defun C:GRAPH (/ *error* radius drawn)
  90. (defun *error* (msg)
  91.    (vl-cmdf "_UNDO" "_END")
  92.    (vl-cmdf "_U")
  93.    (setvar "osmode" oom)
  94.    (prompt msg)
  95. )
  96. (setq oom (getvar "osmode"))
  97. (setvar "osmode" 0)
  98. (vl-cmdf "_UNDO" "_BEGIN")
  99. (setq radius (getreal "\nSpecify cirle radius: " ))
  100. (endpoint-circle radius)
  101. (trim-line-circle)
  102. (number-nodes drawn radius)
  103. (vl-cmdf "_UNDO" "_END")
  104. (setvar "osmode" oom)
  105. (princ)
  106. )
  107. ;;;Listing 12.5. New command that automates the creation of network diagrams.
075147htxkbb4dztdsp45d.jpg
命令圆角本质上是交互式的。具有圆边的实体可以编程为实体图元的组合,即复杂实体。
如您所知,没有圆角方法。所以方法是编程一个复杂的实体。
作为实体的交互式修剪,您可以按照我提供的参考进行编程。当然,这只是使用现有方法的一种方式,而不是其他方式。
但它可以节省几次鼠标点击。毕竟,这就是AutolISP的全部内容。
 
顺便说一句,我用作化身的对象是使用AutoLISP制作的3DSolid。。。我觉得有点复杂。
075149m0gpq14p7a1a3azb.jpg
回复

使用道具 举报

15

主题

30

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
74
发表于 2022-7-6 07:41:29 | 显示全部楼层
雷纳尔多·N·多哥,
 
该线程与复杂实体无关。那你为什么一再发布无关信息,误导人们,劫持帖子?
 
我非常感谢你的专业知识,你的化身,你的博客和你的书。但请找到更合适的方式来推广他们,而不是其他人的帖子。
 
对我来说,你的两个帖子都是垃圾邮件。
 
如果你继续这样做,我将不得不停止张贴在这个论坛。
回复

使用道具 举报

0

主题

55

帖子

58

银币

初来乍到

Rank: 1

铜币
1
发表于 2022-7-6 07:45:20 | 显示全部楼层
NirantarVidarthee:
 
我使用AUTOCADLT 2000,它有一个工具栏,上面有三个图标,你只需点击它们。2010年没有工具栏吗??
回复

使用道具 举报

15

主题

30

帖子

16

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
74
发表于 2022-7-6 07:55:35 | 显示全部楼层
由于多哥先生不明白我写了什么,并继续垃圾邮件,我放弃了这个线程。
 
我会尝试从其他论坛获得回复。
 
非常感谢。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 15:05 , Processed in 0.816789 second(s), 68 queries .

© 2020-2025 乐筑天下

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