Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/27/2019 in all areas

  1. A couple of choices rather than initget (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq ans (atof (nth 0 (ah:butts but "v" '("Choose 1: " "1" "0.75" "0.5" "0.25" "0.1" ))))) remembers last picked. Another by lee-mac (if (not LM:LISTBOX)(LOAD "ListBoxV1-2.lsp") (setq lst (list "1" "0.75" "0.5" "0.25" "0.1" )) (LM:LISTBOX "choose" lst 2)
    1 point
  2. Yes there are more things to do with this code but I would like this to be a learning example, getint is the next step or see image below. see last post More advanced next step.
    1 point
  3. The differences that catch my eye are the c : prefix to allow command line invocation, as well as one of the functions having passed variables. This was precisely what I was looking for. Thank you very much to all three of you.
    1 point
  4. You may wish to refer to my explanation here.
    1 point
  5. In addition to @rkmcswain excellent answer above, look at these two functions, and spot the differences (defun function_name (passed vars / local_vars) expressions ) (defun C:function_name ( / local_vars) expressions )
    1 point
  6. The above could alternatively be written: (defun LM:data->xdata ( x ) (cond ( (= 'str (type x)) (list (cons (if (handent x) 1005 1000) x))) ( (= 'real (type x)) (list (cons 1040 x))) ( (= 'int (type x)) (list (cons (if (< -32769 x 32768) 1070 1071) x))) ( (= 'list (type x)) (append '((1002 . "{")) (apply 'append (mapcar 'LM:data->xdata x)) '((1002 . "}")))) ( (list (cons 1000 (vl-prin1-to-string x)))) ) )
    1 point
  7. Perhaps consider a function such as the following: (defun LM:lst->xdata ( lst ) (if lst (append '((1002 . "{")) (apply 'append (mapcar (function (lambda ( x / k ) (cond ( (setq k (cdr (assoc (type x) '((str . 1000) (real . 1040))))) (list (cons k x)) ) ( (= 'int (type x)) (list (cons (if (< -32769 x 32768) 1070 1071) x)) ) ( (= 'list (type x)) (LM:lst->xdata x) ) ( (list (cons 1000 (vl-prin1-to-string x)))) ) ) ) lst ) ) '((1002 . "}")) ) ) ) Example: _$ (LM:lst->xdata '(1 2 3 4)) ((1002 . "{") (1070 . 1) (1070 . 2) (1070 . 3) (1070 . 4) (1002 . "}")) _$ (LM:lst->xdata '(1 (2 3) 4)) ((1002 . "{") (1070 . 1) (1002 . "{") (1070 . 2) (1070 . 3) (1002 . "}") (1070 . 4) (1002 . "}")) _$ (setq lst '((0.52623 (1 2) (0 4)) (0.89652 (2 3) (2 1)))) ( (0.52623 (1 2) (0 4)) (0.89652 (2 3) (2 1)) ) _$ (LM:lst->xdata lst) ( (1002 . "{") (1002 . "{") (1040 . 0.52623) (1002 . "{") (1070 . 1) (1070 . 2) (1002 . "}") (1002 . "{") (1070 . 0) (1070 . 4) (1002 . "}") (1002 . "}") (1002 . "{") (1040 . 0.89652) (1002 . "{") (1070 . 2) (1070 . 3) (1002 . "}") (1002 . "{") (1070 . 2) (1070 . 1) (1002 . "}") (1002 . "}") (1002 . "}") )
    1 point
  8. Again can you post an english translation of the command prompt that you think wants the "width" input? No other way to figure out what's happening. Annotative text wouldn't ever need "Height" entered, if your code included Height in the Text command call that would cause an issue. It would have the same issue with any Text Style that had a Height not set to 0. Test the Height of the current text style in your code with: (cdr (assoc 40 (tblsearch "style" (getvar "textstyle")))) If include Height or don't include Height
    1 point
  9. (setvar 'TEXTJUSTIFY "Left") will set DTEXT Justification to the default "Left".
    1 point
×
×
  • Create New...