通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  列兵

注册:2009-7-52
跳转到指定楼层
1#
发表于 2021-7-9 17:25:11 |只看该作者 |倒序浏览
;;;**以下文字直线平行********************************************************************
(DEFUN C:pinxin (/ a ent ent1 et lineanglelinelist1 linelist2 linept1  linept2n  name s)
(repeat 100
(princ "\n选择需旋转的文字:")
(setq s (ssget '((0 . "TEXT")) ))
(setq et (entget (car (entsel "\n选择角度线:"))))
(setq linelist1 (assoc 10 et))
(setq linelist2 (assoc 11 et))
(setq linept1 (list (nth 1 linelist1) (nth 2 linelist1)))
(setq linept2 (list (nth 1 linelist2) (nth 2 linelist2)))
(setq lineangle (angle linept1 linept2));计算弧度
  
(setq tang (/ (* lineangle 180) pi));转成角度
     
(setq angh (/ (* tang pi) 180));转成弧度
  
(setq n (sslength s))
(setq a 1)
(while (<= a n)
   (setq name (ssname s (- a 1)))
   (setq ent (entget name))
   (setq ent1 (subst (cons 50 angh) (assoc 50 ent) ent))
   (entmod ent1)
   (setq a (+ a 1))
  )
))

举报本楼

本帖有 10 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2024-5-11 19:53 , Processed in 0.130746 second(s), 19 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部