Author Topic: Convert VLA-OBJECT IVector  (Read 1704 times)

0 Members and 1 Guest are viewing this topic.

FELIX

  • Bull Frog
  • Posts: 241
Convert VLA-OBJECT IVector
« on: February 01, 2019, 02:17:15 PM »
How to convert "VLA-OBJECT IVector"? Read your content.
OK.

Gemini

  • Mosquito
  • Posts: 6
Re: Convert VLA-OBJECT IVector
« Reply #1 on: February 20, 2020, 07:08:24 AM »

Rod

  • Newt
  • Posts: 185
Re: Convert VLA-OBJECT IVector
« Reply #2 on: February 23, 2020, 06:13:05 PM »
Hi Felix,
did you have any luck with this?
From memory the iVector contained a list of numerators and a list denominators that corresponded with degrees minutes and seconds

I copied this directly from the code I already posted https://www.theswamp.org/index.php?topic=38072.msg592382#msg592382

Code - Auto/Visual Lisp: [Select]
  1. (defun getgpsvalue (vectorObj / Numlist Denomlist i numerator denominator dms dd)
  2.   (setq Numlist (getitemfromcollection vectorobj "Numerator"))
  3.   (setq Denomlist (getitemfromcollection vectorobj "Denominator"))
  4.   (setq i 0)
  5.   (repeat 3
  6.     (if (and (setq numerator (nth i Numlist))
  7.              (setq denominator (nth i Denomlist))
  8.              (not (zerop denominator))
  9.         ) ;_ end of and
  10.       (setq dms (cons (/ (float numerator) denominator) dms))
  11.       (setq dms (cons 0 dms))
  12.     ) ;_ end of if
  13.     (setq i (1+ i))
  14.   ) ;_ end of repeat
  15.   (setq dms (reverse dms))
  16.   (setq dd (getdecimaldegrees dms))
  17. ) ;_ end of defun

Cheers, Rod.
"All models are wrong, some models are useful" - George Box

Rod

  • Newt
  • Posts: 185
"All models are wrong, some models are useful" - George Box