Author Topic: Will PAY $$ fpr lsp - MODIFY TEXT  (Read 10066 times)

0 Members and 1 Guest are viewing this topic.

mhcadman

  • Guest
Will PAY $$ fpr lsp - MODIFY TEXT
« on: May 02, 2008, 05:54:25 PM »

 :)

PLEASE HELP!!!!

MODIFYING EXISTING TEXT

1st- the text can be mtext, mostly the text will be plain text.

2nd - the command will be placed in a toolbar button, for example: (load "chgtxt");chtxt

3rd - yes I know how to perform theses tasks one at a time.. it gets old after hours and hours of repetitious attribute editing.

4th - please respond only if you can write the program..  criticism isn't going to solve anything...  this is the program I want, period.  Maybe  in return, I can help you with something in Microstation.

humble cad man,,,,, mike....

-------------------------------------------------------------------------------
I've tried searching the web and using ACAD help but I can't make this lsp happen.

I need a lsp program that will change existing text.......

Existing test is:   PLAN EL.180'-0"

I want to select existing text to change.
 
Once selected, I want the selected text to be "UNDERLINED (adding %%u to the beginning- %%uEL.180'-0" )", the "STYLE" to change to "STD35E", the
"HEIGHT" to change to 3", the "LAYER" to change to "CY1".

An additional "help" (but not required) would be to have the lsp read a "data file" to import the "STYLE, HEIGHT, and LAYER". (Underlining will always be required.)
Different "data files" for multiple requirements.

Sincerely,
Mike

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #1 on: May 02, 2008, 06:08:15 PM »
That doesn't sound like it isnt that hard of a procedure/request.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

mkweaver

  • Bull Frog
  • Posts: 352
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #2 on: May 02, 2008, 06:20:35 PM »
Here's something to get you up and running.  Note that the layer and the text style must already exist or the routine will fail.
Zero error checking here (and zero testing)


Code: [Select]
(defun chgtxt( / obj oldstring newstring)
  (setq
    obj (vlax-ename->vla-object (car (entsel)))
    OldString (vla-get-textstring obj)
    NewString (vla-put-textstring obj (strcat "%%U" oldstring))
    )
  (vla-put-stylename obj "STD35E")
  (vla-put-height obj 3)
  (vla-put-layer obj "CY1")
  )code]

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #3 on: May 02, 2008, 06:31:59 PM »
%%U doesnt work on mtext.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #4 on: May 02, 2008, 07:09:37 PM »
If you really want to pay for this, make a donation to theSwamp.

[ http://www.theswamp.org/donate.html ]

Code: [Select]
(defun c:MyTest (/ ActDoc)
   
    (setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
    (vla-EndUndoMark ActDoc)
    (vla-StartUndoMark ActDoc)
    (vla-Add (vla-get-Layers ActDoc) "CY1")
    (vla-Add (vla-get-TextStyles ActDoc) "STD35E")
    (if (ssget'((0 . "*TEXT")))
        (vlax-for obj (vla-get-ActiveSelectionSet ActDoc)
            (if (= (vla-get-ObjectName obj) "AcDbText")
                (vla-put-TextString obj (strcat "%%U" (vla-get-TextString obj)))
                (vla-put-TextString obj (strcat "{\\L" (vla-get-TextString obj) "}"))
            )
            (vla-put-StyleName obj "STD35E")
            (vla-put-Layer obj "CY1")
            (vla-put-Height obj 3)
        )
    )
    (vla-EndUndoMark ActDoc)
    (princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #5 on: May 02, 2008, 07:25:24 PM »
*blink-blink*
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

M-dub

  • Guest
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #6 on: May 02, 2008, 07:31:20 PM »
Nice thought, Tim.  :)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #7 on: May 02, 2008, 07:33:24 PM »
*blink-blink*
Hope I didn't step on your toes, or anyone else's.  Or did I not do what the OP wanted?

Nice thought, Tim.  :)
Thanks.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #8 on: May 02, 2008, 07:37:04 PM »
Hope I didn't step on your toes, or anyone else's.  Or did I not do what the OP wanted?

I'm broke!! ...But, I guess $20 wouldn't have gotten me very much so no harm i guess. 
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #9 on: May 02, 2008, 07:38:41 PM »
Hope I didn't step on your toes, or anyone else's.  Or did I not do what the OP wanted?

I'm broke!! ...But, I guess $20 wouldn't have gotten me very much so no harm i guess. 
I don't think the OP saw it yet, so I can take it away.   :evil:

Just for you.   :-)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #10 on: May 02, 2008, 07:42:55 PM »
Quote from: OP Title
Will PAY $$ fpr lsp


...But, I guess $20 wouldn't have gotten me very much .........


 :|  I thought the offer was 2$ ( $$ )    :laugh:


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.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #11 on: May 02, 2008, 07:44:52 PM »
Quote from: OP Title
Will PAY $$ fpr lsp


...But, I guess $20 wouldn't have gotten me very much .........


 :|  I thought the offer was 2$ ( $$ )    :laugh:



If he's broke, 2$ is at least something to get him started.   :lmao:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #12 on: May 02, 2008, 08:28:14 PM »
Ok, im going to do some slight modifications to my version and you two are going to test it. But i need to know what bank you guys use and your favorite 4 digits first. 
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #13 on: May 02, 2008, 09:29:13 PM »
You should add (vl-load-com) to the beginning of both of those lisp routines.
Just in case it wasn't loaded already.
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.

M-dub

  • Guest
Re: Will PAY $$ fpr lsp - MODIFY TEXT
« Reply #14 on: May 03, 2008, 12:23:02 AM »
See, look at this...  This is typical of members of theSwamp.

Keep smilin' everyone.  :)