(defun exifdata
(file
/ idata
) ;;/ err idata iprop imgObj )
) ;_ end of and
) ;_ end of lambda
) ;_ end of function
) ;_ end of vl-catch-all-apply
) ;_ end of setq
;;(dumpall iprop)
(setq idata
(getall iprop
)) ;;(dumpall idata)
) ;_ end of progn
) ;_ end of if
;_ end of if
) ;_ end of progn
) ;_ end of if
iprop
) ;_ end of defun
;;take a list of files return a list of dotted pairs eg ("Filename" . "C:temp")("Latitude" -35.4576)(Longtitude "149.1234)
;;;(defun C:test (/ idata)
;;; (setq file (getfiled "" "" "" 0))
;;; (setq iprop (exifdata file))
;;; (setq lat (getgpslat valuelist))
;;; (setq long (getgpslong valuelist))
;;; (rel)
;;; (setq pt (list long lat))
;;; (setq actpt (lltoact pt))
;;; (princ)
;;;) ;_ end of defun
(defun c:test
(/ pathAndFiles path files file imageFiles locationsList
) (setq pathAndFiles
(dos_getfilem "Select images to insert into drawing" "Y:\\" "*.JPG;*.JPEG;*.PNG;*.TIFF")) ) ;_ end of foreach
(setq locationsList
(getImageLocations imagefiles
)) (insertPhotoLocationBlocks locationsList)
) ;_ end of defun
(defun insertPhotoLocationBlocks
(locationsList
) (command "insert" "PHOTO LOCATION" pt
1 1 rot
) (command "insert" "PHOTO LOCATION" pt
1 1 0) ) ;_ end of if
(command "-hyperlink" "insert" "object" "last" "" file
"" file
) ) ;_ end of foreach
) ;_ end of defun
) ;_ end of if
) ;_ end of foreach
) ;_ end of defun
(defun getImageLocations
(imageList
) (setq locationlist
(getImageLocation imgObj imageFile
)) (setq locationsList
(cons locationlist locationsList
)) (princ (strcat "\nCouldn't find location for " imageFile
)) ) ;_ end of if
) ;_ end of progn
) ;_ end of if
) ;_ end of foreach
nil
) ;_ end of if
) ;_ end of defun
(defun getImageLocation
(imgObj imageFile
) ) ;_ end of lambda
) ;_ end of function
) ;_ end of vl-catch-all-apply
) ;_ end of setq
(setq idata
(getall iprop
)) (setq lat
(getgpslat idata
)) (setq long
(getgpslong idata
)) (setq dir
(getGpsDir idata
)) (setq actpt
(lltoact pt
)) ) ;_ end of progn
) ;_ end of if
;;; (if (= 'vla-object (type iprop))
;;; (vlax-release-object iprop)
;;; ) ;_ end of if
(list imageFile actpt dir
) ) ;_ end of defun
;;;(defun getall (collection / err x valuelist)
;;; ;;
;;; (setq
;;; err (vl-catch-all-apply
;;; (function
;;; (lambda nil
;;; (vlax-for x collection
;;; ;;(vlax-dump-object x T)
;;; (setq
;;; valuelist
;;; (cons (cons (vlax-get-property x 'name)
;;; (vlax-variant-value
;;; (vlax-get-property x 'value)
;;; ) ;_ end of vlax-variant-value
;;; ) ;_ end of cons
;;; valuelist
;;; ) ;_ end of cons
;;; ) ;_ end of setq
;;; ) ;_ end of vlax-for
;;; ) ;_ end of lambda
;;; ) ;_ end of function
;;; ) ;_ end of vl-catch-all-apply
;;; ) ;_ end of setq
;;;
;;; (if (listp valuelist);;(null (vl-catch-all-error-p err))
;;; (reverse valuelist)
;;; ) ;_ end of if
;;;) ;_ end of defun
(defun getall
(collection
/ err x valuelist name prop
) ) ;_ end of if
;;(vlax-dump-object x T)
;_ end of setq
) ;_ end of vlax-for
;;(null (vl-catch-all-error-p err))
) ;_ end of if
;;; (foreach x (reverse valuelist)
;;; (princ (strcat "\n" (vl-princ-to-string x)))
;;; ) ;_ end of foreach
) ;_ end of defun
(defun dumpall
(collection
)
) ;_ end of vlax-for
) ;_ end of lambda
) ;_ end of function
) ;_ end of vl-catch-all-apply
) ;_ end of setq
) ;_ end of if
) ;_ end of defun
(defun getitemfromcollection
(collection itemname
/ valuelist
) valuelist
valuelist
) ;_ end of cons
) ;_ end of setq
) ;_ end of vlax-for
) ;_ end of lambda
) ;_ end of function
) ;_ end of vl-catch-all-apply
) ;_ end of setq
nil
) ;_ end of if
) ;_ end of defun
(defun getGpsLatref
(idata
/ dottedpair ref
) ) ;_ end of if
) ;_ end of if
) ;_ end of defun
(defun getGpsLongref
(idata
/ dottedpair ref
) ) ;_ end of if
) ;_ end of if
) ;_ end of defun
(defun getimagewidth
(idata
) nil
) ;_ end of if
) ;_ end of defun
(defun getimageheight
(idata
/ dottedpair
) nil
) ;_ end of if
) ;_ end of defun
(defun getGpsLat
(idata
/ gpsLatobj
) (setq lat
(getgpsvalue gpsLatobj
)) (setq ref
(getGpsLatref idata
)) ) ;_ end of and
(* lat ref)
nil
) ;_ end of if
) ;_ end of defun
) ;_ end of and
(setq imgDir
(- imgDir
12.9)) ) ;_ end of if
) ;_ end of defun
(defun getGpsLong
(idata
/ gpslongobj
) (setq long
(getgpsvalue gpslongobj
)) (setq ref
(getGpsLongref idata
)) ) ;_ end of and
(* long ref)
nil
) ;_ end of if
) ;_ end of defun
(defun getgpsvalue
(vectorObj
/ Numlist Denomlist i numerator denominator dms dd
) (setq Numlist
(getitemfromcollection vectorobj
"Numerator")) (setq Denomlist
(getitemfromcollection vectorobj
"Denominator")) (setq denominator
(nth i Denomlist
)) ) ;_ end of and
) ;_ end of if
) ;_ end of repeat
(setq dd
(getdecimaldegrees dms
)) ) ;_ end of defun
(defun getdecimaldegrees
(dms
) ) ;_ end of defun
(ade_projptbackward pt)
) ;_ end of defun
;;pt must be a list in the form of long lat
(ade_projptforward pt)
) ;_ end of defun
(ade_projsetsrc "LL84")
(ade_projsetdest "SGC")
(princ "\nGeo.lsp loaded") (princ "\nGPS.lsp loaded") ;|«Visual LISP© Format Options»
(200 2 40 2 T "end of " 100 20 0 0 0 T T nil T)
;*** DO NOT add text below the comment! ***|;