; ----------------------------------------------------------------------
; (Export LWPOLYLINE Vertices & Points to File)
; Copyright (C) 2000 DotSoft, All Rights Reserved
; Website:
http://www.dotsoft.com
; ----------------------------------------------------------------------
; DISCLAIMER: DotSoft Disclaims any and all liability for any damages
; arising out of the use or operation, or inability to use the software.
; FURTHERMORE, User agrees to hold DotSoft harmless from such claims.
; DotSoft makes no warranty, either expressed or implied, as to the
; fitness of this product for a particular purpose. All materials are
; to be considered ‘as-is’, and use of this software should be
; considered as AT YOUR OWN RISK.
; ----------------------------------------------------------------------
;;Revised 8/23/07 CAB to report coordinates in current UCS
;;Revised 04/15/20 JLM to remove z coordinate and change output format to comma space
;; revised 20-04-2020 by
DEVITG@gmail.com to add enty order number
(DEFUN C:OCZ+NBR (/
;;ELV ENT FH FN HND ITM NUM OBJ PNT SSET
;; keep above comment up to you get it good
;; strip both [;;]
)
(SETQ SSET (SSGET '((-4 . "<OR")
(0 . "POINT")
(0 . "LWPOLYLINE")
(-4 . "OR>"))))
(IF SSET
(PROGN
(SETQ ITM 0)
(SETQ NUM (SSLENGTH SSET))
; (if (itm /= 1)
(SETQ FN (GETFILED "Save OCZ Boundary File" "" "txt" 1))
(IF (/= FN NIL)
(PROGN
(SETQ FH (OPEN FN "w"))
(WHILE (< ITM NUM)
(SETQ HND (SSNAME SSET ITM))
(SETQ ENT (ENTGET HND))
(SETQ OBJ (CDR (ASSOC 0 ENT)))
(COND
((= OBJ "POINT")
(SETQ PNT (CDR (ASSOC 10 ENT)))
(SETQ PNT (TRANS PNT 0 1))
;;**CAB
(PRINC (STRCAT (ITOA (1+ ITM))
;; by DEVITG
", "
(RTOS (CAR PNT) 2 8)
", "
(RTOS (CADR PNT) 2 8))
FH)
; (rtos (caddr pnt) 2 8)) fh)
(PRINC "\n" FH)
)
((= OBJ "LWPOLYLINE")
(IF (= (CDR (ASSOC 38 ENT)) NIL)
(SETQ ELV 0.0)
(SETQ ELV (CDR (ASSOC 38 ENT)))
)
(FOREACH REC ENT
(IF (= (CAR REC) 10)
(PROGN
(SETQ PNT (CDR REC))
(SETQ PNT (TRANS PNT 0 1))
;;**CAB
(PRINC (STRCAT (ITOA (1+ ITM))
;; by devitg
", "
(RTOS (CAR PNT) 2 8)
", "
(RTOS (CADR PNT) 2 8))
FH)
; (rtos elv 2 8)) fh)
(PRINC "\n" FH)
)
)
)
)
(T NIL)
)
(SETQ ITM (1+ ITM))
)
(CLOSE FH)
(PRINC
(STRCAT "\nThe Coordinates of " (ITOA ITM) " " (ITOA NUM) " have been written to the file."))
)
)
)
)
(PRINC)
(STARTAPP "notepad" FN)
;; by devitg
)
(PRINC "\nPoint Export loaded, type OCZ+NBR to run.")
(PRINC)
;|«Visual LISP© Format Options»
(180 2 1 0 nil "end of " 100 20 2 2 nil nil T nil T)
;*** DO NOT add text below the comment! ***|;