乐筑天下

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

[编程交流] LISP自动加载gro

[复制链接]

4

主题

70

帖子

66

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 17:06:08 | 显示全部楼层 |阅读模式
谁来帮我修改代码。请
 
  1. (defun C:llt()
  2. (command "-linetype" "l" "cen*" "acadiso.lin" "")
  3. (command "-linetype" "l" "hid*" "acadiso.lin" "")
  4. (princ)
  5. )
回复

使用道具 举报

4

主题

70

帖子

66

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 17:16:36 | 显示全部楼层
...正在努力,这就是我得到的。看起来效果不错。
有什么建议吗?
 
 
  1. (defun c:llt()
  2. (setq a "Center")
  3. (if (= (tblsearch "ltype" a) nil)  
  4.       (command "-linetype" "l" a "acadiso.lin" "")
  5.             (princ))
  6. (setq b "Center2")
  7. (if (= (tblsearch "ltype" b) nil)  
  8.       (command "-linetype" "l" b "acadiso.lin" "")
  9.             (princ))
  10. (setq c "Centerx2")
  11. (if (= (tblsearch "ltype" c) nil)  
  12.       (command "-linetype" "l" c "acadiso.lin" "")
  13.             (princ))
  14. (setq d "Hidden")
  15. (if (= (tblsearch "ltype" d) nil)  
  16.       (command "-linetype" "l" d "acadiso.lin" "")
  17.             (princ))
  18. (setq e "Hidden2")
  19. (if (= (tblsearch "ltype" e) nil)  
  20.       (command "-linetype" "l" e "acadiso.lin" "")
  21.             (princ))
  22. (setq f "Hiddenx2")
  23. (if (= (tblsearch "ltype" f) nil)  
  24.       (command "-linetype" "l" f "acadiso.lin" "")
  25.             (princ))
  26. (princ)
  27. )
回复

使用道具 举报

2

主题

439

帖子

536

银币

限制会员

铜币
-14
发表于 2022-7-6 17:34:35 | 显示全部楼层
exatra代码过多:
  1. (defun c:llt()
  2. (foreach lt '("Center" "Center2" "Centerx2" "Hidden" "Hidden2" "Hiddenx2")
  3.    (if(not(tblsearch "ltype"lt))
  4.      (command "_.-linetype" "_l" lt "acadiso.lin" "")
  5.      ); end if
  6.    ); end foreach
  7. (princ)
  8. ); end of c:llt
回复

使用道具 举报

4

主题

70

帖子

66

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 17:40:24 | 显示全部楼层
谢谢你,阿斯米!
回复

使用道具 举报

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 17:53:58 | 显示全部楼层
如果您想在行中添加一些单词,这可能会有所帮助。不知道如何缩短第二个点,若文字短于3个字母,我想它会把def放在文件夹中,而不是你们从那个里编辑。
 
  1. ;Tip1684:   LTXT.LSP      Linetype Generator     (c)2001, Darren Marker
  2. (defun
  3.     C:LTXT ()
  4. (setvar "cmdecho" 0)
  5. (setq V:CLAYER (getvar "clayer"))
  6. (setq V:EXPERT (getvar "expert"))
  7. (if (not V:LINET)
  8.    (setq V:LINET "XX")
  9. ) ;_ end of if
  10. (setq V:LINET_X
  11.         (getstring
  12.           (strcat
  13.             "\n \n \nEnter line text: <"
  14.             V:LINET
  15.             ">"
  16.           ) ;_ end of strcat
  17.         ) ;_ end of getstring
  18. ) ;_ end of setq
  19. (if (/= V:LINET_X "")
  20.    (setq V:LINET (strcase V:LINET_X))
  21. ) ;_ end of if
  22. (setq V:LINET (strcase V:LINET))
  23. (LT_MAKER)
  24. ) ;_ end of defun
  25. (defun
  26.     LT_MAKER ()
  27. (setvar "expert" 4)
  28. (setq V:LINET_L (strlen V:LINET))
  29. (setq V:LINET_W (rtos (* V:LINET_L 0.1) 2 1))
  30. (setq V:LT_FILE "c:\\temp\\lt_temp.lin")
  31. (setq V:LT_VAR1 (open V:LT_FILE "w"))
  32. (setq V:LT_TEXTL1
  33.         (strcat
  34.           "*" V:LINET "," V:LINET "----" V:LINET "----" V:LINET "----"
  35.           V:LINET
  36.          ) ;_ end of strcat
  37. ) ;_ end of setq
  38. (setq V:LT_TEXTL2
  39.         (strcat
  40.           "A,5.5,-1.5,["
  41.           (chr 34)
  42.           V:LINET
  43.           (chr
  44.             34
  45.           ) ;_ end of chr
  46.           ",SIMPLEX,S=0.1,R=0.0,X=-1.25,Y=-0.25],-"
  47.           V:LINET_W
  48.         ) ;_ end of strcat
  49. ) ;_ end of setq
  50. (setq V:LT_VAR2 (write-line V:LT_TEXTL1 V:LT_VAR1))
  51. (setq V:LT_VAR3 (write-line V:LT_TEXTL2 V:LT_VAR1))
  52. (close V:LT_VAR1)
  53. (command "-linetype" "l" V:LINET V:LT_FILE "")
  54. (setvar "expert" V:EXPERT)
  55. (command ".celtype" V:LINET)
  56. (princ
  57.    (strcat
  58.      "\n \n \nCurrent Layer -"
  59.      (getvar
  60.        "clayer"
  61.      ) ;_ end of getvar
  62.    ) ;_ end of strcat
  63. ) ;_ end of princ
  64. (princ)
  65. (princ
  66.    (strcat
  67.      "\n \n \nCurrent Entity linetype set to:"
  68.      V:LINET
  69.    ) ;_ end of strcat
  70. ) ;_ end of princ
  71. (princ)
  72. (setq V:PNT1 (getpoint "\nPick start point:"))
  73. (command ".line" V:PNT1)
  74. (while
  75.    (setq V:PT
  76.           (getpoint
  77.             (getvar "lastpoint")
  78.             "\nNext point
  79.             or <Return to
  80.             terminate>:"
  81.           ) ;_ end of getpoint
  82.    ) ;_ end of setq
  83.     (command V:PT)
  84. ) ;_ end of while
  85. (command)
  86. (command)
  87. (setvar "celtype" "bylayer")
  88. (princ)
  89. (princ
  90.    "\n \nLine-Text terminated.  Linetype set to
  91.             BYLAYER:"
  92. ) ;_ end of princ
  93. (princ)
  94. ) ;_ end of defun
  95. (princ)
  96. (princ " Line-Text Loaded...")
  97. (princ)
  98. (princ
  99. (strcat
  100.    "\n \n"
  101.    (chr 34)
  102.    "LTXT"
  103.    (chr 34)
  104.    " to
  105.             execute:"
  106. ) ;_ end of strcat
  107. ) ;_ end of princ
  108. (princ)
回复

使用道具 举报

4

主题

70

帖子

66

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 18:02:39 | 显示全部楼层
我已经尝试了你的代码连接应用程序,但它没有给出我想要的。我不知道这是否只是因为我不知道如何使用或什么,但它不起作用。无论如何,ASMI的代码已经足够好了。
谢谢你的努力。
回复

使用道具 举报

40

主题

132

帖子

107

银币

后起之秀

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

铜币
227
发表于 2022-7-6 18:09:37 | 显示全部楼层
是的,那家伙是国王
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 19:30 , Processed in 0.353972 second(s), 66 queries .

© 2020-2025 乐筑天下

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