Author Topic: Lisp request: replace text with an attribute  (Read 4361 times)

0 Members and 1 Guest are viewing this topic.

One Shot

  • Guest
Lisp request: replace text with an attribute
« on: May 25, 2007, 02:46:23 PM »
I am working on a long process for replace text with an attribute for rooms with room tags.

Pseudo code:
Select pick points inside of a boundary like when you are hatching,
Then it would automatically selects the text in the boundary,
And then would it inserts the attribute inside the boundary

This lisp would continue without stopping each time.  Here is the layer the attribute should inserted on. (A-Anno-Occp) attached is the attribute.

Thank you for you help!

Brad


**edit** changed subject line
« Last Edit: May 25, 2007, 02:58:18 PM by Mark Thomas »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Lisp request
« Reply #1 on: May 25, 2007, 02:50:35 PM »
Why don't you just use 'ssget' to select the text in each room, erase the text, and fill in the information within the block with the items that were in the text?  Would be much easier to write.

What have you started?
Tim

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

Please think about donating if this post helped you.

One Shot

  • Guest
Re: Lisp request
« Reply #2 on: May 25, 2007, 02:55:41 PM »
Here is a lisp that was written.  I just want to remove two steps from it.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Lisp request: replace text with an attribute
« Reply #3 on: May 25, 2007, 03:44:48 PM »
I don't see an easier way to do it.  Maybe someone else will see a way.
Tim

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

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp request: replace text with an attribute
« Reply #4 on: May 31, 2007, 10:08:23 AM »
I am working on a long process for replace text with an attribute for rooms with room tags.

Pseudo code:
Select pick points inside of a boundary like when you are hatching,
Then it would automatically selects the text in the boundary,
And then would it inserts the attribute inside the boundary

Brad, the routine you uploaded expects the block with attributes to already exist inside the area pline. Does it? Or is it plain text?
Are you simply swapping the block out or is there some change in the block attribute info or position of the block?
If you can select the Block or better yet the boundary pline you can make it work easily.
Are you doing limited replacements or the entire DWG being updated?

Why don't you post a DWG sample of before & after?

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.

One Shot

  • Guest
Re: Lisp request: replace text with an attribute
« Reply #5 on: June 01, 2007, 10:28:08 AM »
Cab, 

Hello, how is everything going?  I have attached two sample files that shows what I am doing.  The drawing that is named (before) has text inside of a boundry that designates the room number.  The drawing that is named (after) has the attribute called Room-tag inside each boundry.  When that attribute is inserted, it would take the room number inside the boundry and automatically place is in the attribute.  When you look at the attribute, you will find a place holder for the room number. Also, could you please add a command to this routine to get the area in sq. ft. and add it to the attirbute.  When you look at the attribute, you will find a place holder for the area.

Thank you,

Brad

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Lisp request: replace text with an attribute
« Reply #6 on: June 01, 2007, 11:33:44 AM »
Here is a lisp that was written.  I just want to remove two steps from it.

Curious; why the view & twist part of your code?  Just house keeping I assuming?
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Lisp request: replace text with an attribute
« Reply #7 on: June 01, 2007, 04:37:33 PM »
Not perfect by any means. Something for YOU to improve upon.
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.

One Shot

  • Guest
Re: Lisp request: replace text with an attribute
« Reply #8 on: June 08, 2007, 03:51:06 PM »
Thank you Cab.  I really appreciate it you are the man!