Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/14/2020 in all areas

  1. You're most welcome Chris - I'm glad you were able to pinpoint the issue!
    1 point
  2. What is returned when you enter the following at the command line? (findfile "TITLEBLOCKDATA.csv") Does the erroneous file reside in an AutoCAD Support Path?
    1 point
  3. Thanks Chris - it looks like the debug program has run successfully (reporting "All attributes are up-to-date.") - are you sure you're testing the main program exactly as it appears on my site, as I'm perplexed as to why the debug program ran successfully when it is merely printing additional messages to the command line.
    1 point
  4. Thanks - could you please run the attached debug version and report back the command line history? UTB_Debug.lsp
    1 point
  5. The duplicate elements present in each list make this task slightly trickier than it would otherwise be - here is an alternative solution: (defun f ( a b ) (mapcar '(lambda ( x / z ) (setq z b) (list x (foreach y x (setq z (LM:removeonce y z)))) ) a ) ) (defun LM:removeonce ( x l / f ) (setq f equal) (vl-remove-if '(lambda ( a ) (if (f a x) (setq f (lambda ( a b ) nil)))) l) ) _$ (f a b) ( ((750.0 500.0 500.0) (400.0)) ((750.0 500.0 400.0) (500.0)) ((750.0 500.0 400.0) (500.0)) ((500.0 500.0 400.0) (750.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 500.0) (500.0 400.0)) ((750.0 400.0) (500.0 500.0)) ((500.0 500.0) (750.0 400.0)) ((500.0 400.0) (750.0 500.0)) ((500.0 400.0) (750.0 500.0)) ((750.0) (500.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((500.0) (750.0 500.0 400.0)) ((400.0) (750.0 500.0 500.0)) )
    1 point
  6. Are you able to upload a sample CSV file?
    1 point
  7. Use an alphanumerical sorting function to interpret & sort numerical data within the string, rather than sorting character-wise, e.g. to sort layouts alphanumerically, you might use: (defun c:sortlayouts ( / ls1 ls2 ord ) (vlax-for lyt (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= :vlax-false (vla-get-modeltype lyt)) (setq ls1 (cons (strcase (vla-get-name lyt)) ls1) ls2 (cons lyt ls2) ) ) ) (setq ord 0) (foreach idx (LM:alphanumsort-i ls1) (vla-put-taborder (nth idx ls2) (setq ord (1+ ord))) ) (princ) ) ;; Alphanumerical Sort-i - Lee Mac ;; Sorts a list of strings containing a combination of alphabetical & numerical characters and returns the indices. (defun LM:alphanumsort-i ( lst ) (vl-sort-i (mapcar 'LM:splitstring lst) (function (lambda ( a b / x y ) (while (and (setq x (car a)) (setq y (car b)) (= x y) ) (setq a (cdr a) b (cdr b) ) ) (cond ( (null x) b) ( (null y) nil) ( (and (numberp x) (numberp y)) (< x y)) ( (numberp x)) ( (numberp y) nil) ( (< x y)) ) ) ) ) ) ;; Split String - Lee Mac ;; Splits a string into a list of text and numbers (defun LM:splitstring ( str ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (apply 'append (mapcar (function (lambda ( a b c ) (cond ( (or (= 34 b) (= 92 b)) (list 32 34 92 b 34 32) ) ( (or (< 47 b 58) ;(and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) (list b) ) ( (list 32 34 b 34 32)) ) ) ) (cons nil l) l (append (cdr l) '(( ))) ) ) ) ")" ) ) ) (vl-string->list str) ) ) (vl-load-com) (princ)
    1 point
  8. Are you testing using the program exactly as it appears on my site, or have you modified it at all? I ask because you should not be receiving this error message: ; error: bad argument type: stringp nil
    1 point
  9. Does your CSV file use a different delimiter to that used by your system regional settings? Try opening the CSV file in a plain text editor (such as Windows Notepad), and replacing the commas with semi-colons.
    1 point
×
×
  • Create New...