找回密码
 注册会员
查看: 868|回复: 0

[文章] 线形反向lsp程序

  [复制链接]
发表于 2009-3-28 20:12:15 |Error| 显示全部楼层 |阅读模式

我们不再是孤独的探索者;让我们的手紧紧相连,一起成长。

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

×
**线形反向***
(defun c:fx()
    
(setq ss(ssget) mun 0)
(repeat (sslength ss)
    
(setq entl-y (ssname ss mun))
    
(command "pedit" entl-y "d" "")
    
(setq entl(entget entl-y))
   
(if (= "POLYLINE" (cdr(assoc 0 entl))) (command "pedit" entl-y "lt" "on" "x"))
    (if (= 10 (car (nth 13 entl))) 
(setq nn 13))
    (if (= 10 (car (nth 12 entl))) 
(setq nn 12))
    (setq lt-name(cdr(assoc 6 entl)) la-name (cdr (assoc 8 entl)))  

    (setq W_list '())
    
(setq elem (cdr (nth nn entl)))
    (setq w_list (append w_list (list elem))) 

   (while (not (null elem))         
  (setq nn(+ nn 4))
  (setq elem (cdr (nth nn entl))) 

   
(if (= (car (nth nn entl)) 10)
    (setq w_list (append w_list (list elem))) ;构建实体
坐标表  
   
)
   
)
    
(setq w_list (reverse w_list))
    
(setq pt1 (car W_list))
    
(command "pline" pt1)
   
(while w_list
    
(setq w_list(cdr w_list))
    
(setq pt (car w_list))
    
(command pt)
   
)
    
(command "")
    
(command "chprop" (entlast) "" "lt" lt-name "la" la-name "")
    
(command "pedit" (entlast) "lt" "on" "s" "")
    
(command "erase" entl-y "")
    
(setq mun (+ mun 1))
)
)
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

小黑屋|手机版|Cncad.Net ( 苏ICP备2026083443号 )

GMT+8, 2026-11-1 19:33 , Processed in 0.226543 second(s), 21 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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