Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2024 in all areas

  1. @3dwannab FWIW - Here is how I would re-write @BIGAL's code above to have some basic error handling to prevent an invalid MLINESTYLE from being created (Yes - I found out it will create an MLINESTYLE with no elements). (defun c:MAKMLSTYLE (/ des i lst mle mln off) (setq mln (getstring "\nEnter a name of the MLINE Style: ") des (getstring t "Enter a Description for the MLINE Style:") des (if (= des "") mln des) ) (while (setq off (getreal "\nEnter MLINE Offsets one value at a time, then ENTER to continue: " )) (setq lst (cons off lst)) ) (if (and (/= mln "") lst (> (length lst) 1)) (progn (setq mle (list '(0 . "MLINESTYLE") '(100 . "AcDbMlineStyle") (cons 2 mln) (cons 70 (+ 16 256)) (cons 3 des) '(62 . 256) (cons 51 (/ pi 2.)) (cons 52 (/ pi 2.)) (cons 71 (setq i (length lst))) ) ) (repeat i (setq mle (append mle (list (cons 49 (nth (setq i (1- i)) lst)) (cons 62 256) (cons 6 "BYLAYER") ) ) ) ) (if (not (dictadd (cdar (dictsearch (namedobjdict) "ACAD_MLINESTYLE")) mln (entmakex mle))) (Alert (strcat "Unable to create MLINESTYLE \"" mln "\"\nThe Style May already Exist.")) (progn (Princ (strcat "\nMLINESTYLE \"" mln "\" Created.")) (setvar 'cmlstyle mln) ) ) ) (progn (if (= mln "")(Princ "\nYou must provide a Name for the MLINESTYLE. ")) (if (< (Length lst) 2)(princ "\nThe MLINESTYLE must have at least 2 elements.")) ) ) (princ) )
    1 point
  2. I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the correct forum.
    1 point
  3. I allways use (alert (strcat "whatever : " (vl-princ-to-string whoever))) , even if whoever is nil , alert function still alerts. sorry I have no time to respond more because my agency asked me to help one of its clients with a problem while my dayjob is also quite intense at this moment (end of year stress) so I work from 6am till 5pm for dayjob and 6pm to 0.00am for the other job (and this 24/7 , a couple of weeks in a row so far) I wrote (of course) an app for the second job but it took me 2 whole weekends , starting friday from 6pm and 'finished' on sunday 10pm , only left my cave for food and sanitary stops. Hope to finish the second job this week / weekend so next week I only have day job left , no pressure haha. Don't think I'll ever gonna take on two jobs at the same time any time soon.
    1 point
  4. A quick google and found by Lee-mac a solution, a further edit by Codeding added page sizes. Google is your friend. But must use correct syntax. "lee-mac get number of pages in pdf autocad lisp" Any way https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/insert-pdf-pages-help/td-p/9890051
    1 point
×
×
  • Create New...