Author Topic: changing existing text to new style  (Read 2138 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
changing existing text to new style
« on: February 19, 2010, 03:42:06 PM »
Good afternoon,
So am I just dyslexic, ...  I've searched repeatedly for this and can't find a thing.  But I know it has been discussed before.
I am looking for a segment of code, (preferably LiSP) to change a selection of existing text to a new text style.

And while we're on the topic, how does the search function work ??  You guys will undoubtedly show me some links to other discussions that I haven't found, but I guess I don't know how to search for anything.  I feel so stupid.    :|
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: changing existing text to new style
« Reply #1 on: February 19, 2010, 04:04:49 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: changing existing text to new style
« Reply #2 on: February 19, 2010, 04:08:32 PM »
Two ways of many:

Code: [Select]
(defun c:test (/ Styl i ss ent)

  (setq Styl "Standard")

  (if (and (tblsearch "STYLE" styl)
           (setq i -1 ss (ssget "_:L" '((0 . "MTEXT,TEXT")))))
    (while (setq ent (ssname ss (setq i (1+ i))))
      (entmod
        (subst
          (cons 7 Styl) (assoc 7 (entget ent)) (entget ent)))))

  (princ))
Code: [Select]
(defun c:test (/ Styl obj ss)
  (vl-load-com)

  (setq Styl "Standard")

  (if (and (tblsearch "STYLE" styl)
           (ssget "_:L" '((0 . "MTEXT,TEXT"))))
    (progn     
      (vlax-for obj (setq ss (vla-get-ActiveSelectionSet
                               (vla-get-ActiveDocument (vlax-get-acad-object))))
        (vla-put-StyleName obj Styl))
     
      (vla-Delete ss)))

  (princ))

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: changing existing text to new style
« Reply #3 on: February 19, 2010, 04:10:50 PM »
You can start your search here:
http://www.theswamp.org/index.php?topic=24700.msg359343#msg359343

The key for me using search is coming up with a phrase and then put it within quotes to
limit the number of hits. Also search only the relevant forums.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: changing existing text to new style
« Reply #4 on: February 19, 2010, 04:28:37 PM »
You can start your search here:
http://www.theswamp.org/index.php?topic=24700.msg359343#msg359343

The key for me using search is coming up with a phrase and then put it within quotes to
limit the number of hits. Also search only the relevant forums.

Yep, searching is a little like magic ;  the incantations are just as important as the pot.



ohhhhhhhhhh  thats almost quotable :)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Hangman

  • Swamp Rat
  • Posts: 566
Re: changing existing text to new style
« Reply #5 on: February 19, 2010, 04:33:21 PM »
You can start your search here:
http://www.theswamp.org/index.php?topic=24700.msg359343#msg359343

The key for me using search is coming up with a phrase and then put it within quotes to
limit the number of hits. Also search only the relevant forums.

Yep, searching is a little like magic ;  the incantations are just as important as the pot.



ohhhhhhhhhh  thats almost quotable :)
ALMOST ???  Definately quotable !!!
Alright, so, ...
How do I make it forum specific ??  Every try I've made so far has pulled up all the forums.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: changing existing text to new style
« Reply #6 on: February 19, 2010, 04:37:31 PM »
Select 'Advanced Search'

Select 'Choose a board to search in, or search all'

Set your search criteria and Choose the forums
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: changing existing text to new style
« Reply #7 on: February 19, 2010, 06:04:02 PM »
Should look like this:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.