明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1031|回复: 0

[源码] 市政综合标高辅助计算程序

[复制链接]
发表于 2018-4-14 16:50:23 | 显示全部楼层 |阅读模式
(defun C:Q1( )
   (graphscr)
   (setvar "cmdecho" 0)
   (draw_gz20180315)
   (princ)
)

(defun draw_gz20180315 ()         
(graphscr)
(setq oce0 (getvar "dimzin"))
(setq oce2 (getvar "cmdecho"))
(setvar "cmdecho" 0);系统参数
(setvar "dimzin"  0)
(setvar "osmode" 1)
(command "-style" "QCDL" "tssdeng.shx,tssdchn.shx" 0  0.67 0  "" "" "")
(command "-layer"  "n"  "qcgzdim1"  "c" 4 "qcgzdim1" "")
(command "-layer"  "n"  "qcgzdim2"  "c" 1 "qcgzdim2" "")
;;;(command "-layer"  "n"  "qcgzdim3"  "c" 7  "L" "center" "qcgzdim3" "")
;;;(command "layer" "new" "qcgzdim3" "s" "qcgzdim3" "C" 1 "" "L" "Center" "" "LW" 0.09 "" "")
(command "layer" "new" "qcgzdim3" "s" "qcgzdim3" "C" 7 "" "L" "Center" ""  "")
(vl-load-com)

(setq QCGZgdlx (getreal "\n输入管道类型项[水平管(0)/横向管(1)]<0>:"))
(if (= QCGZgdlx nil) (setq QCGZgdlx 0))
(setq QCGZJL (getreal "\n输入管线与道路中线的距离,中线左侧输入负数,右输入正数<0>:"))
(if (= QCGZJL nil) (setq QCGZJL 0))
(setq QCGZdmgc (getreal "\n输入设计地面高程<20>:"))
(if (= QCGZdmgc nil) (setq QCGZdmgc 20))
(setq QCGZgc (getreal "\n输入结构底高程<15>:"))
(if (= QCGZgc nil) (setq QCGZgc 15))
(setq QCGZgd (getreal "\n输入结构高度<1.2>:"))
(if (= QCGZgd nil) (setq QCGZgd 1.2))
(setq QCGZpt1 (getpoint "\n拾取道路设计线上的点:"))


(setvar "clayer" "qcgzdim2")
(setvar "osmode" 0)
(setq QCGZpt2 (polar QCGZpt1 0 -30))
(setq QCGZpt2a (polar QCGZpt1 0 30))
(command ".pline" QCGZpt2 "W" 0 ""  QCGZpt2a  "" )
(setvar "clayer" "qcgzdim3")
(setq QCGZpt1a (polar QCGZpt1 (* -0.5 pi) 20))
(command ".pline" QCGZpt1 "W" 0 ""  QCGZpt1a  "" )

  (cond
  ((= QCGZgdlx 0)
   (setq  QCGZL 50)
   (setvar "clayer" "qcgzdim1")

  )
  ((= QCGZgdlx 1)
   (setq  QCGZL 1)
   (setvar "clayer" "qcgzdim2")

   )
)


(setq QCGZpt3 (polar QCGZpt1 0 QCGZJL))
(setq QCGZpt4a (polar QCGZpt3 (* -0.5 pi) (- QCGZdmgc QCGZgc)))

(setq QCGZpt4 (polar QCGZpt4a 0 (* -0.5 QCGZL)))
(setq QCGZpt5 (polar QCGZpt4 0 QCGZL))
(setq QCGZpt6 (polar QCGZpt5 (* 0.5 pi) QCGZgd))
(setq QCGZpt7 (polar QCGZpt4 (* 0.5 pi) QCGZgd))
(command ".pline" QCGZpt4 "W" 0 ""  QCGZpt5 QCGZpt6 QCGZpt7 "C" )

(setq QCGZpt8 (polar QCGZpt4 0 (* 0.5 QCGZL)))
(setq QCGZpt9 (polar QCGZpt8 (* 0.5 pi) 0.2))
(command ".TEXT"  "M"  QCGZpt9  0.3  0    (rtos QCGZgc 2 2) );结构底高程

(setq QCGZpt10 (polar QCGZpt7 0 (* 0.5 QCGZL)))
(setq QCGZpt11 (polar QCGZpt10 (* 0.5 pi) 0.2))
(command ".TEXT"  "M"  QCGZpt11  0.3  0    (rtos (+ QCGZgc QCGZgd) 2 2) );结构顶高程

(setq QCGZpt12 (polar QCGZpt1 0 1))
(setq QCGZpt13 (polar QCGZpt12 (* 0.5 pi) 0.2))
(command ".TEXT"  "M"  QCGZpt13  0.3  0    (strcat "设计地面高程" (rtos QCGZdmgc 2 2)) );设计路面高程


    (command "cecolor" "bylayer")
    (setvar "dimzin" oce0)
    (setvar "osmode" 175)
    (setvar "cmdecho" oce2)
    (princ)
  )

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

本版积分规则

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

GMT+8, 2025-5-19 16:00 , Processed in 0.161368 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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