I know the odds of someone explaining the hex generation are slim to none but that code will definitely come in handy.
?? Not sure I understand what you mean by 'explain the hex generation'.
An aside, converting a file's binary data to hex per this thread can be done by exploiting this
ReadStream function (this isn't the most efficient route, but said code is already written) as well as other sample code in this thread:
(defun _FileToHex ( file / stream )
(if (setq stream (_ReadStream file nil))
(_Encode_Binary_Chunk
(vl-string->list stream)
)
)
)However, when testing, never, ever do this:
(_FileToHex "c:/docs/some_file.xls")It will take a long time and then your screen will be deluged with a monsoon of data.
Rather, do something like this:
(progn
(setq hex_data (_FileToHex "c:/docs/some_file.xls"))
(princ)
)Afterwards query the var:
(substr hex_data 1 16) >>> "D0CF11E0A1B11AE1"Finally, if adding it to dxf group data via the 310 group keep in mind you will have to do it in string 'packets', each a maximum of 254 chars (representing 127 bytes), i.e.
...
310 . "D0CF11E0A1B11AE1..."
310 . "A1B11D0CF11E0AE1..."
310 . "0D0CF1AEA1B1111E..."
...Verbosely yours, mp.