Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/08/2024 in all areas

  1. Usually fonts follow the same chr # but different languages or a custom font might not be the right number you can use this to find the corrrect # ;;----------------------------------------------------------------------------;; ;; Output Character ASCii number table (defun C:text_table (/ vars vals base i c tx base_n) (setq vars '(snapmode osmode cmdecho ATTDIA ATTREQ LUPREC) ;list of variables vals (mapcar 'getvar vars) ;store old values ) (mapcar 'setvar vars '(0 0 0 0 1 0)) ;set new values (setq base (getpoint "\nEnter Starting Point :") i 0 c 0 n (/ (getvar 'textsize) 8) H (getvar 'textsize) ) (while (< i 1000) (setq tx (strcat (AT:NumFix (itoa i) 4) " = " (chr i)) base_n (list (+ (car base) (* (fix (* (/ c 25) n)) 100)) (- (cadr base) (* 20 (* c n)))) ) (entmake (list '(0 . "TEXT") (cons 8 (getvar 'clayer)) (cons 10 base_n) (cons 40 H) (cons 1 tx) (cons 7 (getvar 'textstyle)) ) ) (setq i (1+ i)) (setq c (1+ c)) (if (eq c 25) ;simple counter to step over (progn (setq base (polar base 0 3)) (setq c 0) ) ) ) (mapcar 'setvar vars vals) ;restore old values (princ) ) (defun AT:NumFix (s n) ;; Fix number string with leading zeros ;; s - Number string to fix ;; n - Number of characters for final string ;; Alan J. Thompson, 10.29.09 ;; (AT:NumFix i 3) i= 1 = 001 (if (< (strlen s) n) (AT:NumFix (strcat "0" s) n) s ) )
    2 points
  2. Thank you so much, steven It works perfectly.
    1 point
  3. Something like this: Linetype is the line name "TRAZOS" (I don't think it i case sensitive) acad.lin is the line definition file that the line type is described in - you might need to find out what that is and replace the text below assumes here that the file 'acad.lin' is in trusted files location (defun MakeLoadLines ( linetype / ) (if (tblsearch "LTYPE" linetype) ;;Check if linetype is loaded (command ".-linetype" "_Load" linetype "acad.lin" "_Yes" "") ;; reload it anyway. Replace with (progn ) for no reloading (command ".-linetype" "_Load" linetype "acad.lin" "") ;; otherwise load it ) (princ) )
    1 point
  4. Well, assuming that by "poles" you mean "texts", try this: (defun c:pp( / txt points delete) (setq precision 300) (setq pl (entsel "Select the polyline")) (princ "\nselect TEXTs to align") (setq txt (ssget '((0 . "TEXT")))) (princ "\nselect the polyline (again)\n") (setq elast (entlast)) (command "divide" pause precision) (setq points nil delete nil) (repeat (- precision 3) (setq elast (entnext elast) delete (cons elast delete) points (cons (cdr (assoc 10 (entget elast))) points)) ) (repeat (setq i (sslength txt)) (setq tx1 (ssname txt (setq i (1- i))) a10 (cdr (assoc 10 (setq el (entget tx1)))) dist 1e5 closest 0 j -1) (repeat (length points) (setq d1 (distance a10 (nth (setq j (1+ j)) points)) dist (if (> dist d1) (setq closest j dist d1) dist)) ) (entmod (subst (cons 50 (angle a10 (nth closest points))) (assoc 50 el) el)) ) (foreach del1 delete (entdel del1)) ) It is not mathematical accurate, but I think it does the job. The precision is set to 300 (see the 2nd program line), it can be raised to about 32000, but it will slow down the program. Waiting to your feed-back!
    1 point
  5. I just saw your name and am cracking up.
    1 point
  6. If you look inside this there is a get sheets function, it makes a list of the sheets, you can pass that to a listbox dcl. Just copy that function out. Alan Excel library.lspIt also has the Get & Put cells.
    1 point
  7. and \U+00B2 for squared or \U+00B3 for cubed as an alternative to Alt+ ("\U+.... " works better in LISP) Can also use (chr 178) and (chr 179) ... which is why LISP is brilliant - so many ways to do the same thing! "\n Area = " (rtos a 2 2) " m\U+00B2" "\n Area = " (rtos a 2 2) " m " (chr 178)
    1 point
  8. @ILoveMadoka You might take a look at THIS too. It will let you increment your blocks by simply dragging the cursor over them.
    1 point
  9. easiest way is to draw an object on drawing 1 on the right layer, copy and paste into drawing 2 and delete both objects You could look at Lee Macs website, and his Steal LISP which will do the same
    1 point
×
×
  • Create New...