Author Topic: Is there something better than vl-string-subst?  (Read 8053 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Is there something better than vl-string-subst?
« Reply #15 on: January 08, 2011, 10:32:43 AM »
I mostly use this, or just a quick chr/ascii at the console is usually quickest.

pBe

  • Bull Frog
  • Posts: 402
Re: Is there something better than vl-string-subst?
« Reply #16 on: January 14, 2011, 11:51:40 PM »
fwiw ... a quick & dirty little proggy:

MP
can you write a python version of this code and post it on General Programming board  :-)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Is there something better than vl-string-subst?
« Reply #17 on: January 15, 2011, 01:35:27 AM »
MP
can you write a python version of this code and post it on General Programming board  :-)

there ya go  :-)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

pBe

  • Bull Frog
  • Posts: 402
Re: Is there something better than vl-string-subst?
« Reply #18 on: January 15, 2011, 04:38:23 AM »
MP
can you write a python version of this code and post it on General Programming board  :-)

there ya go  :-)

Thank you kind sir  :-)

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is there something better than vl-string-subst?
« Reply #19 on: January 18, 2011, 02:19:57 PM »
Here's where I find mine:
http://www.asciitable.com/

GDF

  • Water Moccasin
  • Posts: 2081
Re: Is there something better than vl-string-subst?
« Reply #20 on: January 18, 2011, 03:25:49 PM »
here's an oldie
Code: [Select]
;;;CHARACTR.lsp by Jeff Foster 01/17/96
;;;Recommended that this routine be run in a blank drawing
;;;This routine generates 16 columns and 16 rows of text
;;;consisting of each of the 256 %% characters available
;;;in a particular font and numbers each character.
;;;Modified by Gary Fowler  07/30/99
(Defun c:CHARACTR ()
  (setq cnt 1.0)
  (setq r_cnt 0.0)
  (setq x 0.0)
  (setq y 0.0)
  (setq sub_y (- y 0.1))
  (command "layer" "m" "textfont" "c" "4" "" "")
  (setvar "osmode" 0)
  (repeat 16
    (while (<= (fix cnt) (+ r_cnt 16))
      (setq pt (list x y))
      (setq sub_pt (list x sub_y))
      (command "text"
       "m"
       pt
       "0.05"
       "0"
       (strcat "%%" (rtos cnt 2 0))
      )
      (command "text" "m" sub_pt "0.05" "0" (rtos cnt 2 0))
      (setq x (+ x 0.2))
      (setq cnt (+ cnt 1.0))
    )
    (setq r_cnt (+ r_cnt 16))
    (setq x 0)
    (setq y (- y 0.2))
    (setq sub_y (- y 0.1))
  )
;;;(cdr (assoc 3 (tblsearch "STYLE" (cdr (assoc 7 (entget (car (entsel))))))))
  (setq
    fontnam (cdr
      (assoc
3
(tblsearch "STYLE" (cdr (assoc 7 (entget (entlast)))))
      )
    )
  )
  (name_font)
  (command "zoom" "e")
  (command "zoom" "0.95x")
  (princ)
)
(defun name_font ()
  (command "layer" "m" "textstyle" "c" "2" "" "")
  (setq name1 (strcat "Textstyle is \"" (getvar "textstyle") "\""))
  (setq name2 (strcat "Font is " fontnam))
  (setvar "osmode" 0)
  (command "text" "j" "bl" "0.0,0.33" "0.125" "0" name1 "" "")
  (command "text" "j" "bl" "0.0,0.125" "0.125" "0" name2 "" "")
  (setq name_style
nil
name nil
  )
  (princ)
)
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

efernal

  • Bull Frog
  • Posts: 206
Re: Is there something better than vl-string-subst?
« Reply #21 on: January 18, 2011, 03:44:04 PM »
I use this:

(DEFUN c:char ()
  (STARTAPP (FINDFILE (STRCAT (GETENV "WINDIR") "\\SYSTEM32\\CHARMAP.EXE")))
  (PRINC)
)

e.fernal