;测试: (str2lst "Hello 2World 12 5456.1568") -> ("Hello" "2World" "12" "5456.1568")
;版权所有,盗用必究!如在程序中引用,请保留文字信息行.
(defun str2lst (str /)
(read(vl-list->string
(apply 'append(mapcar '(lambda (x)(if (= 32 x) (list 34 32 34) (list x)))(append (list 40 34)(vl-string->list str)(list 34 41))))
) )
)
按 X, Y, Z 排序坐标表(AutoLISP, VisualLISP解决方案):
按 X, Y, Z 排序坐标表(AutoLISP, VisualLISP解决方案):<BR> <BR> 1) 用AutoLISP实现的代码:<BR> <BR>2) 用VisualLISP(vl-sort函数)实现的代码:
回复
无痕, 专家, 谢谢支持! 转贴一个秋枫的点表按照xyz排序的程序Sort_and_Write_pList :见附件(defun Sort_and_Write_pList (fname plist / fp pt)
;; sort plist first
(setq plist (vl-sort plist
'(lambda (p1 p2)
(cond ((< (car p1) (car p2)) T)
((and (= (car p1) (car p2))
(< (cadr p1) (cadr p2))
)
T
)
((and (= (car p1) (car p2))
(= (cadr p1) (cadr p2))
(< (caddr p1) (caddr p2))
)
T
)
(T nil)
)
)
)
) 再来一个,更简洁的通用程序,有人顶么?有人顶再贴:)
别这样吗
别这样吗,贴出来吧! 我不喜欢唱独角戏,让我换个思路再想想,争取用别的方法再写一个出来我们期待
我们期待着... 本帖最后由 作者 于 2004-5-3 14:14:57 编辑vl-remove 的纯lsp写法;| (x:removeat at lst ) = 表剔除元素;-------------无痕.2004.1
;提示;等同于: (vl-remove element-to-remove list)
(x:removeat "a" '(58 3 (a . 8) "a" 4.5)) -> (58 3 (A . 8) 4.5)
|;
(defun x:removeat (at lst) ;at=atom
(apply 'append (subst nil (list at) (mapcar 'list lst)))
)xex 炸开嵌套块.;xex = 炸开嵌套块.-----by 无痕.2004.4
(defun c:xex ()
(princ "\n炸开嵌套块.--------------by 无痕.2004.4")
(setvar "qaflags" 1)
(setq ss (ssget '((0 . "INSERT"))))
(while (setq ss (ssget "P" '((0 . "INSERT"))))
(command ".explode" ss "")
)(princ)
)
<A name=15603><FONT color=#0000ff><B>无痕</B></FONT></A>兄真了不起!佩服ing!