明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1020|回复: 0

求助,这个“结构柱子”源程序能否按要求修改?

[复制链接]
发表于 2008-6-9 15:07 | 显示全部楼层 |阅读模式

这是它人编写的“结构柱子”的源程序,请问能否在生成结构柱子的同时沿柱子外角点生成外框线,外框线可以是line/lp线,谢谢!

;       =============================================
;       |             构造柱自动标注软件            |
;       |         版本: V1.0   作者: 尉迟俊岭       |
;       =============================================
(defun C:gzz(/ dx dy dx1 dx2 dy1 ddx ddy lay pt1 pt2 width scale)
  (setvar "CMDECHO" 0)
  (setq lay (getvar "clayer"))
  (command "color" "bylayer")
  (command "layer" "m" "gzz" "c" "m" "gzz" "")
  (setq scale (getreal "\nScale<1>: "))
  (cond ((= scale nil) (setq scale 100.0))
        ((= scale 1) (setq scale 100.0))
        ((= scale 100) (setq scale 1.0))
  )
  (command "osnap" "int")
  (setq pt (getpoint "\nInsert point: "))
  (command "osnap" "non")
  (setq width (getreal "\nWidth of GZZ<240>: "))
  (if (= width nil) (setq width 240))
  (setq width (/ width scale))
  (setq ddx (getreal "\nX-distance form insert point<0>: "))
  (if (= ddx nil) (setq ddx 0))
  (setq ddx (/ ddx scale))
  (setq high (getreal "\nhigh of GZZ<240>: "))
  (if (= high nil) (setq high 240))
  (setq high (/ high scale))
  (setq ddy (getreal "\Y-distance form insert point<0>: "))
  (if (= ddy nil) (setq ddy 0))
  (setq ddy (/ ddy scale))
  (setq dy (cadr pt))
  (setq dx (car pt))
  (setq dx1 (+ (- dx (/ width 2)) ddx))
  (setq dx2 (+ dx1 width))
  (setq dy1 (+ dy ddy))
  (setq pt1 (list dx1 dy1))
  (setq pt2 (list dx2 dy1))
  (command "pline" pt1 "w" high high pt2 "") 
  (command "layer" "s" lay "")
  (princ)
)     

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

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-2 19:09 , Processed in 0.244613 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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