Author Topic: Manipulate existing text  (Read 2371 times)

0 Members and 1 Guest are viewing this topic.

mhcadman

  • Guest
Manipulate existing text
« on: April 02, 2008, 08:10:07 PM »
PLEASE HELP!!!!
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 then right-click to accept.

After the right-click, 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" would 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.

(bribes will be considered  :-) )

Sincerely,
Mike

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Re: Manipulate existing text
« Reply #1 on: April 02, 2008, 10:27:41 PM »

How many do you need to change ?

just to put things in perspective, it will take about 6 seconds to change those with the Properties dialog/palette.


and about 10 seconds to remember the name and load the special program to do it automagically.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Manipulate existing text
« Reply #2 on: April 02, 2008, 11:54:20 PM »
Welcome to the Swamp Mike.

Creating STYLES & Layer's is easy in lisp via the command.
Also there are several subroutines found in these threads to do just that.

If you are selecting the text why do you need a Right Click to confirm?
Why would you select the text if you are not wanting to change it?

Do you know some lisp programing?

Do you want to select each text to change one at a time?

We can get you going but we need a little more information.
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.

daron

  • Guest
Re: Manipulate existing text
« Reply #3 on: April 03, 2008, 12:56:05 AM »
One question that comes to mind right off the bat is: is this plain text or is there the possibility of Mtext? It does make a difference.

mhcadman

  • Guest
Re: Manipulate existing text
« Reply #4 on: April 03, 2008, 10:54:55 AM »
Thank you for your replies!

The lsp will be placed in a toolbar button so the 10 seconds argument is out.

I was using the "6 second change text via propties box" which gets old after about a hundred times and clicking the "text contents box" getting to the beginning of the text and entering %%u, more clicking finding the correct "style", more clicking and entering the "height" and more clicking to enter the "layer".

Mostly it's PLAIN text, seldom MTEXT.

I would not purposely select text i did not want to change.

Isolating the text layer then selecting them all at once then changing them with this new lsp would be great!

It doesn't have to have a right click to accept, in fact, if i pick the text and the lsp changes it instantly without any further intervention on my part, perfect.

I am still learning acad lsp, obviously.
Give me Microstation UCM or BAS any time.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Manipulate existing text
« Reply #5 on: April 03, 2008, 11:24:39 AM »
So first things first. You need pseudo code.

Here is my pseudo code. Please correct any miss understandings.

  • User selects single text object for identification.
  • Get the layer & type of object, likely TEXT object. And text characters?
  • Get all matching objects in the current space, likely Model Space.
  • If needed make Style
  • If needed make layer
  • Iterate through the selection set changing layer, style, & height.
  • Also change characters "PLAN" to "%%u"
  • Report number of objects changed.


Answer these What IF questions:
Layer of text is locked?
Layer "CY1" exist & is locked?
Characters "PLAN" is missing?
Do you need to match the identifying Text objects characters exactly?
Do you need to match Character Case exactly? Upper/lower
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.