Jump to content

Add more information


AIberto

Recommended Posts

Hello,guys

 

I Want add more information to make QRCODE. I've done a little bit of searching for this, but have not found what I've needed.

 

This is a DEMO

(defun c:tt()
 (setq        str
        "1111111011101101001111111-1000001011100101001000001-1011101010110110001011101-1011101011010011001011101-1011101000000110101011101-1000001010011101101000001-1111111010101010101111111-0000000001001100000000000-1100111000010011000101111-0111110111101100101001110-1001101000011010010101011-0101010110110111001111001-1101111100101100110100111-1111010100000001001111110-0000011111000000101000101-0000000111001100111000001-1110101100010011111110001-0000000011101100100011101-1111111000111111101010101-1000001010010110100011001-1011101011101011111110111-1011101001100001110110111-1011101001100011010111110-1000001010101011001101010-1111111011111111110011111"
 )
 (setq pt0 (getpoint "\nSpecify base point:"))
 (setq pt0 (polar (polar pt0 (/ pi 2) 0.5) pi 1.0))
 (setq str0 str
ls1 nil
 )
 (while (wcmatch str0 "*-*")
   (setq n (vl-string-search "-" str0)
  ls1 (cons (substr str0 1 n) ls1)
  str0(substr str0 (+ 2 n))
   )
 )
 (setq ls1 (reverse (cons str0 ls1))
ls1 (mapcar 'vl-string->list ls1))
 (mapcar
   '(lambda(y)
      (setq pt1 (polar pt0 (/ pi -2) 1.0)
     pt0 pt1
      )
      (mapcar
 '(lambda(x)
    (setq pt1 (polar pt1 0.0 1.0))
    (if (= x 49)
      (mkpl pt1)
    )
  )
 y
      )
    )
   ls1
 )
 (princ)
)
(defun mkpl(pt)
 (entmake (list '(0 . "lwpolyline")
  '(100 . "AcDbEntity")
  '(100 . "AcDbPolyline")
  '(90 . 2)
  '(43 . 1.0)
  (cons 10 pt)
  (cons 10 (polar pt 0.0 1.0))
   )
 )
)

 

But can only make a fixed information . I want Enter more information,

like this:

 

Enter information: xxxxxxx , [Next/ Done] , N (Enter the next one)

Enter information: xxxxxxx [Next/Done] , D (Finish)

 

I found some …… maybe can help .

http://www.theswamp.org/index.php?topic=44091.msg493463#msg493463

Lee's function ,Thanks.

(defun int2hex ( n )
   (cond
       (   (< n 10) (chr (+ n 48)))
       (   (< n 16) (chr (+ n 55)))
       (   (strcat (int2hex (/ n 16)) (int2hex (rem n 16))))
   )
)

(defun str->url ( s )
   (apply 'strcat
       (mapcar
           (function
               (lambda ( a )
                   (cond
                       (   (or (<= 65 a 90) (<= 97 a 122) (member a '(45 46 95 126))) (chr a))
                       (   (= a 32) "+")
                       (   (< a 16) (strcat "%0" (int2hex a)))
                       (   (strcat "%" (int2hex a)))
                   )
               )
           )
           (vl-string->list s)
       )
   )
)

 

Can help me ? or

Will you share what you've written to do that? Thanks very much!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...