; Pline's vertices to txt file
(defun C:test ( / LM:group-n SS i o e L fp opn )
;; Group by Number-Lee Mac
;; Groups a list 'l' into a list of lists, each of length 'n'
(defun LM:group-n ( l n / r )
(if l
(cons
(reverse (repeat n (setq r (cons (car l) r) l (cdr l)) r))
(LM:group-n l n)
)
)
)
(cond
(
(not
(progn
(setq SS (ssget '((0 . "*POLYLINE"))))
(repeat (setq i (sslength SS))
(setq o (vlax-ename->vla-object (setq e (ssname SS (setq i (1- i))))))
(if (vlax-property-available-p o 'Coordinates)
(setq L (cons (cons (cdr (assoc 210 (entget e))) (LM:group-n (vlax-get o 'Coordinates) 3)) L))
)
); repeat
L
)
)
(princ "\nInvalid objects selected.")
)
( (not (setq fp (getfiled "Create vertices data" "" "txt" 1)))
(princ "\nText file not specified.")
)
( (setq opn (open fp "w"))
(princ "X \tY \tZ" opn)
(mapcar
'(lambda (a b)
(mapcar
'(lambda (x)
(princ
(strcat "\n"
(vl-string-left-trim "\t"
(vl-string-right-trim ", "
(apply 'strcat (mapcar '(lambda (n) (strcat "\t" (rtos n 2 2) ", ")) (trans x a 1)))
)
)
)
opn
)
)
b
)
)
(mapcar 'car L)
(mapcar 'cdr L)
)
(close opn)
(initget "Yes No")
(if (= "Yes" (cond ((getkword "\nDo you want to open the file? <Yes>: ")) ("Yes")))
(startapp "explorer" fp)
)
)
); cond
(princ)
);| defun |; (vl-load-com) (princ)
一个绘图示例会有帮助,我不知道你是否可以发布一个文件附件,直到你有10个帖子-达武德
他们可以发布任何东西,链接是有节制的,通过“高级”>“管理附件”将图像和文件发布到CADTutor,无需任何节制。 非常感谢!这正是我需要的。工作起来很有魅力。
页:
1
[2]