Announcement

Collapse
No announcement yet.

help on this please???

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • help on this please???


    i asked others for help, and they are very kind to help me, but im already shy to ask more... but i need to add the length and the angle of a line, on my extraction and i cant figure out how (defun c:LineExtration ( / d e f i s q1 q2 x pt1 pt2 ang dist) (if (and (setq s (ssget '((0 . "LINE")))) (setq f (getfiled "" "" "csv" 1)) (setq d (open f "w")) ) (progn (write-line "Start X,Start Y,Start Z,End X,End Y,End Z,Group" d) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i))))) (write-line (LM:lst->str (append (mapcar 'rtos (cdr (assoc 10 e))) (mapcar 'rtos (cdr (assoc 11 e))) (setq pt1 (cdr (assoc 10 e))) (setq pt2 (cdr (assoc 11 e))) (setq ang (angle pt1 pt2)) (setq dist (distance pt1 pt2)) (mapcar 'rtos ang) (mapcar 'rtos dist) (if (and (setq e (member '(102 . "{ACAD_REACTORS") e)) (setq e (member '(102 . "{ACAD_REACTORS") (entget (setq x (cdr (assoc 330 e)))))) (setq e (cdr (assoc 3 (member (cons 350 x) (reverse (entget (cdr (assoc 330 e)))))))) ) (list e) ) ) "," ) d ) ) (close d) ;09174262900 ) ) (princ) ) (defun LM:lst->str ( lst del ) (if (cdr lst) (strcat (car lst) del (LM:lst->str (cdr lst) del)) (car lst) ) ) (princ)

  • #2
    i forgot to add the attachments sorry
    Attached Files

    Comment

    Working...
    X