明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3489|回复: 7

源码修改

[复制链接]
发表于 2013-1-10 16:56:42 | 显示全部楼层 |阅读模式
下面代码是左边效果,谁能帮我修改成右边效果呀?我在这里谢谢了
(defun c:TF()
(prompt " 【剖面符号】")
(setvar "ORTHOMODE" 1)
(setq oldcmdecho (getvar "cmdecho"))
(setq oldosmode (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 16417)
(setq bili (getvar "dimscale"))
(setq pt1 (getpoint "\n剖切位置起始点(剖切符号内侧):"))
(setq pt1x (car pt1) pt1y (cadr pt1))
(setq pt2 (getpoint pt1 "\n剖切位置结束点(剖切符号内侧):"))
(setq pt2x (car pt2) pt2y (cadr pt2))
(setq pt4x (/ (+ pt1x pt2x) 2))
(setq pt4y (/ (+ pt1y pt2y) 2))
(setq pt4 (list pt4x pt4y))
(setq ang (angle pt1 pt2))
(setq pt5 (polar pt4 (+ ang (* pi 0.5)) 500))
(setq pt1a (polar pt1 (+ ang pi) (* bili 8)))
(setq pt2a (polar pt2 ang (* bili 8)))
(command "pline" pt1 "w" (* bili 0.8) (* bili 0.8) pt1a "")
(setq l_ast (entlast))
(command "change" l_ast "" "p" "c" 3 "" )
(command "pline" pt2  "w" (* bili 0.8) (* bili 0.8) pt2a "")
(setq l_ast (entlast))
(command "change" l_ast "" "p" "c" 3 "" )
(setq tn (getstring "\n剖面代号:"))
(setq pt3 (getpoint pt2a "\n剖面代号位置:"))
(command "-style" "zh" "" 0 1 0 "n" "n" "n")
(command "-text" pt3 (* bili 5) 0 tn)
(setq l_ast (entlast))
(command "mirror" l_ast "" pt4 pt5 "n")
(command "-style" "standard" "" 0 0.75 0 "n" "n" "n")
(setvar "cmdecho" oldcmdecho)
(setvar "osmode" oldosmode)
(setvar "PLINEWID" 0)
(setvar "ORTHOMODE" 0)
(setvar "AUTOSNAP" 61)
(print)
)

本帖子中包含更多资源

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

x
 楼主| 发表于 2013-1-11 08:51:56 | 显示全部楼层
没人吗?自已先顶一个
 楼主| 发表于 2013-1-12 10:52:42 | 显示全部楼层
高手们都那里去了?
 楼主| 发表于 2013-1-15 08:49:44 | 显示全部楼层
等待高出的出现,花儿都谢了
 楼主| 发表于 2013-1-23 13:05:13 | 显示全部楼层
等待高出的出现,花儿都谢了
发表于 2013-3-7 13:57:35 | 显示全部楼层
菜鸟表示无奈  帮顶了
发表于 2015-2-3 17:11:54 | 显示全部楼层
不知道什么情况啊
发表于 2015-2-5 12:37:08 | 显示全部楼层
(defun c:TF()
(prompt " 【剖面符号】")
(setvar "ORTHOMODE" 1)
(setq oldcmdecho (getvar "cmdecho"))
(setq oldosmode (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 16417)
(setq bili (getvar "dimscale"))
(setq pt1 (getpoint "\n剖切位置起始点(剖切符号内侧):"))
(setq pt1x (car pt1) pt1y (cadr pt1))
(setq pt2 (getpoint pt1 "\n剖切位置结束点(剖切符号内侧):"))
(setq pt2x (car pt2) pt2y (cadr pt2))
(setq pt4x (/ (+ pt1x pt2x) 2))
(setq pt4y (/ (+ pt1y pt2y) 2))
(setq pt4 (list pt4x pt4y))
(setq ang (angle pt1 pt2))
(setq pt5 (polar pt4 (+ ang (* pi 0.5)) 500))
(setq pt1a (polar pt1 (+ ang pi) (* bili 8)))
(setq pt1b (polar pt1a (+ ang (* 0.5 pi)) (* bili 8)))
(setq pt2a (polar pt2 ang (* bili 8)))
(setq pt2b (polar pt2a (+ ang (* 0.5 pi)) (* bili 8)))
(command "pline" pt1 "w" (* bili 0.8) (* bili 0.8) pt1a pt1b "")
(setq l_ast (entlast))
(command "change" l_ast "" "p" "c" 3 "" )
(command "pline" pt2  "w" (* bili 0.8) (* bili 0.8) pt2a pt2b "")
(setq l_ast (entlast))
(command "change" l_ast "" "p" "c" 3 "" )
(setq tn (getstring "\n剖面代号:"))
(setq pt3 (getpoint pt2a "\n剖面代号位置:"))
(command "-style" "zh" "" 0 1 0 "n" "n" "n")
(command "-text" pt3 (* bili 5) 0 tn)
(setq l_ast (entlast))
(command "mirror" l_ast "" pt4 pt5 "n")
(command "-style" "standard" "" 0 0.75 0 "n" "n" "n")
(setvar "cmdecho" oldcmdecho)
(setvar "osmode" oldosmode)
(setvar "PLINEWID" 0)
(setvar "ORTHOMODE" 0)
(setvar "AUTOSNAP" 61)
(print)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-19 17:22 , Processed in 0.181610 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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