找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 646|回复: 1

[转贴]:MakeBlock

[复制链接]

已领礼包: 593个

财富等级: 财运亨通

发表于 2006-7-8 17:43:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

  1. ; ***  MakeBlock   [Version 1.0] 4/28/95  ***
  2. ;
  3. ;Copyright 1995 Manu-Soft Computer Services
  4. ;
  5. ; ***************************************
  6. ; ****  Author:  Owen Wengerd        ****
  7. ; ****                               ****
  8. ; ****  Manu-Soft Computer Services  ****
  9. ; ****  P.O. Box 84                  ****
  10. ; ****  Fredericksburg, OH  44627    ****
  11. ; ****  (330) 695-5903               ****
  12. ; ****  Compu-Serve ID:  71324,3252  ****
  13. ; ***************************************
  14. ;
  15. ;
  16. ; This program takes selected objects, defines an anonymous block,
  17. ; then inserts the block at the original location.

  18. (defun C:MAKEBLOCK

  19.   (/ tmp ss ip errexit mbx BLAYER)


  20. ;**************************************************************************
  21.                            
  22.                            ;Layer For Block Placement:
  23.     (setq BLAYER nil)      ;   "XXXX" = Place on layer XXXX
  24.                            ;   nil    = Use current layer

  25. ;**************************************************************************


  26.   (defun errexit (s)
  27.     (princ "\nError:  ")
  28.     (princ s)
  29.     (restore)
  30.   )

  31.   (defun mbx ()
  32.     (setvar "CMDECHO" (car oldvar))
  33.     (setq *error* olderr)
  34.     (princ)
  35.   )

  36.   ;*** Main Program ***
  37.   (setq T (not nil))
  38.   (setq olderr  *error*
  39.         restore mbx
  40.         *error* errexit
  41.   )
  42.   (setq oldvar
  43.     (list
  44.       (getvar "CMDECHO")
  45.     )
  46.   )
  47.   (setvar "CMDECHO" 0)
  48.   (terpri)
  49.   (if BLAYER  
  50.     (command "._LAYER"
  51.       (if (tblsearch "LAYER" BLAYER) "_S" "_M")
  52.       BLAYER
  53.       ""
  54.     )
  55.   )
  56.   (if
  57.     (and
  58.       (setq ip (getpoint "Pick Insertion Point (<0,0,0>): "))
  59.       (setq ss (ssget))
  60.     )
  61.     (progn
  62.       (entmake (list
  63.         (cons '0 "BLOCK")
  64.         (cons '2 "*U")
  65.         (cons '70 1)
  66.         (cons '10 ip)
  67.       ))
  68.       (setq cnt (sslength ss))
  69.       (while (>= (setq cnt (1- cnt)) 0)
  70.         (setq tmp (ssname ss cnt))
  71.         (entmake (setq el (entget tmp)))
  72.         (if (> (cdr (assoc 66 el)) 0)
  73.           (while
  74.             (/= "SEQEND"
  75.               (cdr
  76.                 (assoc 0
  77.                   (entmake (setq el (entget (entnext (cdr (assoc -1 el))))))
  78.                 )
  79.               )
  80.             )
  81.           )
  82.         )
  83.         (entdel tmp)
  84.       )
  85.       (setq tmp (entmake (list (cons '0 "ENDBLK"))))
  86.       (entmake (list
  87.         (cons '0 "INSERT")
  88.         (cons '2 tmp)
  89.         (cons '10 ip)
  90.       ))
  91.     )
  92.   )  
  93.   (restore)
  94. )
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2006-7-9 09:27:12 | 显示全部楼层
正在收集这方面资料,谢谢!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-29 12:24 , Processed in 0.160631 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表