乐筑天下

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

[编程交流] 镜像命令

[复制链接]

15

主题

102

帖子

106

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 15:27:06 | 显示全部楼层
我可以保持Lisp程序,因为我现在在第7行,只是添加镜子是或否的问题谢谢。我现在只想坚持下去,因为这是我现在知道的。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:31:56 | 显示全部楼层
好吧,我想你可以做到,但LISP中有很多是不必要的,它只适用于水平线。-但我会按你的意愿改变它。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:32:58 | 显示全部楼层
添加镜像选项后:
 
  1. (defun c:HB ( / oldsnap ip ent1 ent2 ep1 ep2 edata ip1 ip2)
  2.    (setq oldsnap (getvar "OSMODE"))
  3.    ;get the current snap
  4.    (setvar "OSMODE" 544)
  5.    ;set snap to intersection and nearest
  6.    (setvar "BLIPMODE" 0)
  7.    ;switch blips off
  8.    (setvar "CMDECHO" 0)
  9.    ;switch command echo off
  10.    (while
  11.    ;while an insertion point is selected
  12.    (setq ent1 (entsel "\nSelect Block Insertion Point")  ip (osnap (cadr ent1) "_nea"))
  13.    (setvar "OSMODE" 0)
  14.    ;switch the snap off
  15.    (setq ent2 (entget (car ent1)))
  16.    ;get the entity data of the line
  17.    (setq ep1 (cdr (assoc 10 ent2)))
  18.    ;get the first end point
  19.    (setq ep2 (cdr (assoc 11 ent2)))
  20.    ;get the second end point
  21.    (setvar "ATTDIA" 0)
  22.    ;switch off the attribute dialog box
  23.    (command "Insert" "HBAB" "s" (getvar "dimscale") ip pause pause "" "")
  24.    ;insert the block
  25.    (setq edata (entget (setq en (entlast))))
  26.    ;get the block entity data
  27.    (setq edata (entget (entnext (dxf -1 edata))))
  28.    ;get the attribute entity list
  29.    (setq ip1 (dxf 10 edata))
  30.    ;extract the first attribute insertion point
  31.    (setq edata (entget (entnext (dxf -1 edata))))
  32.    ;get the next attribute entity list
  33.    (setq ip2 (dxf 10 edata))
  34.    ;extract the second attribute insertion point
  35.    (command "Break" ent1 "f" ip1 ip2)
  36.    ;break the line
  37.    (initget "Yes No")
  38.        (setq ans (getkword "\nMirror Block? [Yes/No] <No>: "))
  39.       (if (= ans "Yes")
  40.          (command "_mirror" en "" ip1 ip2 "_Y"))
  41.    (setvar "OSMODE" 544)
  42.    ;switch snap back on
  43.    );while
  44.    (setvar "OSMODE" oldsnap)   
  45.    ;reset snap
  46.    (setvar "BLIPMODE" 1)
  47.    ;switch blips back on
  48.    (setvar "CMDECHO" 1)
  49.    ;switch command echo back on
  50.    (setvar "ATTDIA" 1)
  51.    ;switch attribute dialog boc back on
  52. (princ)
  53. ;finish clean
  54. );defun
  55. ;;;**********************************************************
  56.    
  57. (defun dxf (code elist)
  58. (cdr (assoc code elist))
  59. );defun
  60. (princ)
回复

使用道具 举报

15

主题

102

帖子

106

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 15:37:28 | 显示全部楼层
你说的水平线是什么意思?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:40:47 | 显示全部楼层
好的,你正在找到这条线的起点和终点,(cdr(assoc 10。
 
我假设你想找到线的角度,这样你就可以把块插入到线的正确角度。
回复

使用道具 举报

15

主题

102

帖子

106

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 15:44:36 | 显示全部楼层
 
这是用我的一个块做的,但有一些我不是,因为我的块在0度,其他的是180度,所以更容易选择插入点,并在线上选择一个点来获得这个块的角度。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:47:47 | 显示全部楼层
哦,这个Lisp程序是很多Lisp程序中的一个,但碰巧的是,有了这个Lisp程序,你只需要在0度或180度的角度上做块。
 
我说得对吗?
回复

使用道具 举报

15

主题

102

帖子

106

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 15:50:14 | 显示全部楼层
 
这些木块将被铺设在管道上,因此可以有很多角度。因此,只选择两点角度更容易。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:52:39 | 显示全部楼层
好的,你的选择
 
如果你需要任何其他帮助,请告诉我
回复

使用道具 举报

15

主题

102

帖子

106

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 15:57:55 | 显示全部楼层
 
好的,很酷,谢谢。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 00:35 , Processed in 0.628030 second(s), 71 queries .

© 2020-2025 乐筑天下

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