Results 1 to 1 of 1

Thread: export coordinates from rectangles and polylines within to exfel

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2019-11
    Posts
    1
    Login to Give a bone
    0

    Default export coordinates from rectangles and polylines within to exfel

    Hi forum users,

    i have that lsp file to select
    all rectangles within circles that write the
    coords from the rectangle and the
    circle to an csv file.

    What I need to, is an file that do
    the same wiht polylines within.

    See my attachment files.

    Thanks for help.





    Code:
    (defun c:koords ( / int sel ent pts crd inc ins cir lst csv opn lwp)
      ;;----------------------------;;
      ;;	Tharwat - 18.Feb.2019	;;
      ;;----------------------------;;
      (and (princ "\nSelct visible rectangles :")
           (setq int -1 sel (ssget '((0 . "LWPOLYLINE"))))
           (while (setq ent (ssname sel (setq int (1+ int))))
             (setq pts nil crd nil)
             (and (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (p) (= (car p) 10)) (entget ent))))
                  (setq inc -1 ins (ssget "_WP" pts '((0 . "CIRCLE"))))
                  (while (setq cir (ssname ins (setq inc (1+ inc))))
                    (setq crd (cons (cdr (assoc 10 (entget cir))) crd))
                    )
                  (setq lst (cons (list pts crd) lst))
                  )
             )
           ;(setq csv (getfiled "Save csv file" "" "csv" 1))
    	(setq csv (getfiled "Save csv file" "c:/Users/jschmidthammer/Desktop/" "csv" 1))	
    	
           (setq num 0 opn (open csv "w"))
           (mapcar '(lambda (grp) (setq lwp t)
                      (mapcar '(lambda (l)
                                 (if lwp (progn (write-line (strcat "LWpolyline (" (itoa (setq num (1+ num))) ")") opn) (setq lwp nil))
                                   (mapcar '(lambda (str) (write-line str opn)) '("" "Circles"))
                                   )
                                 (mapcar '(lambda (pt)
                                            (write-line (strcat (rtos (car pt) 2) " " (rtos (cadr pt) 2)) opn))
                                         l
                                         )
                                 )
                              grp
                              )
                      (write-line "" opn)
                      )
                   lst
                   )
           (close opn)
           )
      (princ)
      )
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 2016-06-17, 08:20 PM
  2. 2013: How do I export to IFC with project coordinates and not real world coordinates?
    By m.knutsson in forum Revit Architecture - General
    Replies: 2
    Last Post: 2013-10-15, 06:54 AM
  3. Dtext brackets show as rectangles...
    By jeff.benson in forum AutoCAD General
    Replies: 3
    Last Post: 2008-10-02, 08:42 PM
  4. trim everything inside the rectangles
    By windowsxp5 in forum AutoLISP
    Replies: 0
    Last Post: 2005-09-27, 06:58 AM
  5. Romans font, N's printing as rectangles
    By Jettero2112 in forum AutoCAD General
    Replies: 2
    Last Post: 2004-09-10, 12:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •