设为首页收藏本站

晓东CAD家园-论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 757|回复: 2

[源码] 生成布局

[复制链接]

点击这里给我发消息

已领礼包: 81个

财富等级: 招财进宝

发表于 2014-10-25 18:25:37 | 显示全部楼层 |阅读模式

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

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

x
(defun c:scbj()
(vl-load-com)
(setq i 1)
(setq pt (list 1000 1000))
(setq gcm (getint"\n 1_测量平面图 2_地下管线图 : "))
(cond
  ((= gcm 1)
   (setq aaa1 "测量平面图"
      aaa2 "平面图"
   )
  )
  ((= gcm 2)
   (setq aaa1 "地下管线图"
      aaa2 "管线图"
   )
  )
)
(setq gcmc (getstring"\n请输入工程名称: "))
(setq tks (getint"\n输入图框数: "))
(setvar "maxactvp" (+ tks 1))
(repeat tks
  (command "_rectang"  pt (polar pt 0.562575 479.9708))
  (command "_vports" (polar pt 0.785398 4.2426) (polar pt 0.560604 475.834))
  (command "zoom" "w" pt (polar pt 0.562575 479.9708))
  (setq P1 (polar pt 0.142297 281.2383))
  (command "_rectang"  P1 (polar P1 5.99539 129.9487))
        (setq li (list '(0 . "LINE") (cons 8 "tk")))
        (entmake(append li (list (cons 10 (polar P1 4.71239 9.070)) (cons 11 (polar P1 6.21052 124.934) ))))
       (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 4.71239 9.070)) (cons 11 (polar P1 6.21052 124.934)) (cons 8 "tk")));;;横一
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 4.71239 16.024)) (cons 11 (polar P1 6.15529 125.6302)) (cons 8 "tk")));;;横二
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 4.71239 22.977)) (cons 11 (polar P1 6.10083 126.7050)) (cons 8 "tk")));;;横三
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 4.71239 29.931)) (cons 11 (polar P1 6.04744 128.1485)) (cons 8 "tk")));;;横四
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 0 17.9226)) (cons 11 (polar P1 5.1647 41.0082)) (cons 8 "tk")));;;竖1
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 5.94396 48.1540)) (cons 11 (polar P1 5.60102 58.5022)) (cons 8 "tk")));;;竖2
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 6.02941 63.8236)) (cons 11 (polar P1 5.74495 71.9525)) (cons 8 "tk")));;;竖3
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 6.1029  89.3602)) (cons 11 (polar P1 5.88593 95.3359)) (cons 8 "tk")));;;竖4
        (entmakeX (list '(0 . "LINE") (cons 10 (polar P1 6.13094 105.657)) (cons 11 (polar P1 5.94368 110.757)) (cons 8 "tk")));;;竖5
        (command "text" "s"  "宋体" "J" "mc" (polar p1 6.219634 71.4075) "2.5" "" (strcat gcmc aaa1) )
;;绘制签名图框文字
        (setq tkwz (list '(0 . "TEXT") (cons 100 "AcDbText") (cons 100 "AcDbEntity") (cons 8 "tk") (cons 7 "宋体") (cons 40 2.7) ))
        (entmakeX (append tkwz (list (cons 1 "图    名")(cons 10 (polar p1 4.925974 6.0448)))))
        (entmakeX (append tkwz (list (cons 1 "单位名字")(cons 10 (polar p1 5.988877 47.7318)))))
        (entmakeX (append tkwz (list (cons 1 "测量单位")(cons 10 (polar p1 4.802582 14.2492)))))
        (entmakeX (append tkwz (list (cons 1 "项目负责")(cons 10 (polar p1 4.768305 21.1705)))))
        (entmakeX (append tkwz (list (cons 1 "审    核")(cons 10 (polar p1 4.751971 28.2522)))))
        (entmakeX (append tkwz (list (cons 1 "校    核")(cons 10 (polar p1 4.740488 35.2442)))))
        (entmakeX (append tkwz (list (cons 1 "姓名1")(cons 10 (polar p1 5.604974 33.2687)))))
        (entmakeX (append tkwz (list (cons 1 "姓名2")(cons 10 (polar p1 5.460368 37.6800)))))
        (entmakeX (append tkwz (list (cons 1 "姓名3")(cons 10 (polar p1 5.339621 43.1377)))))
        (entmakeX (append tkwz (list (cons 1 "测    量")(cons 10 (polar p1 5.853933 50.9017)))))
        (entmakeX (append tkwz (list (cons 1 "制    图")(cons 10 (polar p1 5.736818 54.1699)))))
        (entmakeX (append tkwz (list (cons 1 "比 例 尺")(cons 10 (polar p1 5.633981 58.2502)))))
        (entmakeX (append tkwz (list (cons 1 "姓名4")(cons 10 (polar p1 5.989676 72.1721)))))
        (entmakeX (append tkwz (list (cons 1 "姓名5")(cons 10 (polar p1 5.900190 74.4819)))))
        (entmakeX (append tkwz (list (cons 1 "1:500")(cons 10 (polar p1 5.823002 78.1785)))))
        (entmakeX (append tkwz (list (cons 1 "编   号")(cons 10 (polar p1 6.053870 91.8580)))))
        (entmakeX (append tkwz (list (cons 1 "图   号")(cons 10 (polar p1 5.981831 93.6748)))))
        (entmakeX (append tkwz (list (cons 1 "日   期")(cons 10 (polar p1 5.912584 95.9687)))))
        (entmakeX (append tkwz (list (cons 1 (strcat aaa2 (rtos i 2 0)))(cons 10 (polar p1 6.027028  109.549 )))))
        (entmakeX (append tkwz (list (cons 1 "2014.09")(cons 10 (polar p1 5.966580  111.517 )))))
  (command "_mspace")
  (command "ucs" "w")
  (command "plan" "c")
  (setq ent (car(entsel (strcat "\n选择图框" (rtos i 2 0) ": "))))
  (setq pt1 (Vlax-Get (Vlax-Ename->Vla-Object ent) 'Coordinates ))
     (setq p10 (list (nth 0 pt1) (nth 1 pt1)))
     (setq p11 (list (nth 2 pt1) (nth 3 pt1)))
     (command "ucs" "n" "3" p10 p11 "")
     (command "plan" "c" )
     (command "zoom" "w" (list 0 0) (list 200 125))
     (command "_pspace")
     (setq pt (polar pt 0 420))
     (setq i (+ 1 i))
)
)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2020-7-26 18:41:33 | 显示全部楼层
谢谢版主分享
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2020-8-1 13:18:42 | 显示全部楼层
有简介怎么用吗
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2020-8-12 11:53 , Processed in 0.123507 second(s), 28 queries , Gzip On, WinCache On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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