Author Topic: text style replacement  (Read 27817 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: text style replacement
« Reply #30 on: January 04, 2007, 07:40:56 PM »
Tim, nice code, you're very productive when you're bored...

An ignorant question, you have the acad object passed in as a variable. Does one ever not use the active document?

Thanks,

Dan

Sometimes, like with DBX or when reading from another db, you will need to pass 'that' doc reference.
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: text style replacement
« Reply #31 on: January 04, 2007, 07:47:46 PM »
Tim, nice code, you're very productive when you're bored...

An ignorant question, you have the acad object passed in as a variable. Does one ever not use the active document?

Thanks,

Dan

Sometimes, like with DBX or when reading from another db, you will need to pass 'that' doc reference.
Yup.  Thanks Kerry.

and Thanks Dan for the nice comment.  I just like the flexibility of it, since the way the code is written it could be called from, and used with, ObjectDBX.
Tim

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

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: text style replacement
« Reply #32 on: January 05, 2007, 08:46:25 AM »
 :?

Tim....

Thank you !
The code work perfectly.

Keep smile...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: text style replacement
« Reply #33 on: January 05, 2007, 11:04:55 AM »
:?

Tim....

Thank you !
The code work perfectly.


I'm glad Andrea.  I hope you can learn from it.  And You're Welcome.
Tim

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

Please think about donating if this post helped you.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: text style replacement
« Reply #34 on: January 05, 2007, 11:15:40 PM »
:?

Tim....

Thank you !
The code work perfectly.


I'm glad Andrea.  I hope you can learn from it.  And You're Welcome.

I lurn each day Tim......but with you guys......I lurn more faster..  :roll:

just a little thing...
the code works perfectly since I got a new drawing from client...
the..
Code: [Select]
....     (if (not IsLo)
      (vla-put-Layer Obj "0")......
section seem to work.....but even with regenall or
Code: [Select]
(vla-Regen (vla-get-ActiveDocument (vlax-get-Acad-Object)) acActiveViewport)all blocks seem to not being refreshed...(<- is this a english word ?)  :|
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: text style replacement
« Reply #35 on: January 05, 2007, 11:19:22 PM »
just a little thing...
the code works perfectly since I got a new drawing from client...
the..
Code: [Select]
....     (if (not IsLo)
      (vla-put-Layer Obj "0")......
section seem to work.....but even with regenall or
Code: [Select]
(vla-Regen (vla-get-ActiveDocument (vlax-get-Acad-Object)) acActiveViewport)all blocks seem to not being refreshed...(<- is this a english word ?)  :|

What do you think Tims code should do to the blocks Andrea ?
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.

Joe Burke

  • Guest
Re: text style replacement
« Reply #36 on: January 07, 2007, 08:32:11 AM »
Hi all,...

first, best wishes for 2007..   :-)

Is there any way to select all text and mtext in the entire drawing including in block, layout, and model space ?

I need to do this:
I have many diffrent text style and need to purge all them and keep only 1.
so I think i need to select all text by filtering them en change style.
But if you have any other idea....i'll keep it !

thanks.

Question aside, why write code given CAD Standards can do this?

I looked at Tim's code, though not in detail. I think it would not allow a text style to be purged if it is used in a dimension style.

IOM, code like Tim's is useful for examining a drawing. Tell me where this or these text styles are used, so I can decide beforehand whether it's safe to let CAD Standards do what it does.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: text style replacement
« Reply #37 on: January 07, 2007, 06:29:34 PM »
just a little thing...
the code works perfectly since I got a new drawing from client...
the..
Code: [Select]
....     (if (not IsLo)
      (vla-put-Layer Obj "0")......
section seem to work.....but even with regenall or
Code: [Select]
(vla-Regen (vla-get-ActiveDocument (vlax-get-Acad-Object)) acActiveViewport)all blocks seem to not being refreshed...(<- is this a english word ?)  :|

What do you think Tims code should do to the blocks Andrea ?

Yes,..
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: text style replacement
« Reply #38 on: January 07, 2007, 06:37:18 PM »
Hi all,...

first, best wishes for 2007..   :-)

Is there any way to select all text and mtext in the entire drawing including in block, layout, and model space ?

I need to do this:
I have many diffrent text style and need to purge all them and keep only 1.
so I think i need to select all text by filtering them en change style.
But if you have any other idea....i'll keep it !

thanks.

Question aside, why write code given CAD Standards can do this?

I looked at Tim's code, though not in detail. I think it would not allow a text style to be purged if it is used in a dimension style.

IOM, code like Tim's is useful for examining a drawing. Tell me where this or these text styles are used, so I can decide beforehand whether it's safe to let CAD Standards do what it does.

some client have standard.....
one of these want only SIMPLEX style in drawings..in 5 specific layers, all block created to layer "0" etc....
but we receive some drawing from architect and diffrent other discipline who work with there standard.
so when we receive these drawing we always need to clean all textstyle and fonts before returning the drawing to the client.

To obtain in the drawing this final result of textstyle:

Standard and SIMPLEX
« Last Edit: January 07, 2007, 06:40:50 PM by Andrea »
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: text style replacement
« Reply #39 on: January 07, 2007, 06:53:19 PM »
......What do you think Tims code should do to the blocks Andrea ?

Yes,..

Lets try that again ...

When you read the code that Tim provided, what do you think it does to blocks ?

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.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: text style replacement
« Reply #40 on: January 07, 2007, 07:52:41 PM »
Code: [Select]
((vl-position tempObjType '("AcDbText" "AcDbMText" "AcDbAttributeDefinition"));;detect text TYPE
     (vla-put-StyleName Obj StyName);;put the new stylename
     (if (not IsLo);;if is not in same layout
      (vla-put-Layer Obj "0");;put the text item found to layer "0"
     )

do I'm right ?
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: text style replacement
« Reply #41 on: January 07, 2007, 07:54:16 PM »
Forget posting  code and try to answer the question ..

When you read the code that Tim provided,
what do you think it does to blocks ?

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.

M-dub

  • Guest
Re: text style replacement
« Reply #42 on: January 07, 2007, 08:33:38 PM »
just a little thing...
the code works perfectly since I got a new drawing from client...
the..
Code: [Select]
....     (if (not IsLo)
      (vla-put-Layer Obj "0")......
section seem to work.....but even with regenall or
Code: [Select]
(vla-Regen (vla-get-ActiveDocument (vlax-get-Acad-Object)) acActiveViewport)all blocks seem to not being refreshed...(<- is this a english word ?)  :|

What do you think Tims code should do to the blocks Andrea ?

Yes,..

Andrea,
Do you think you maybe misunderstood Kerry's question?  He's asking how the code should affect the blocks, not if it should affect the blocks.

just throwing a little hint out there ;)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: text style replacement
« Reply #43 on: January 07, 2007, 08:52:14 PM »

Andrea,
Do you think you maybe misunderstood Kerry's question?  He's asking how the code should affect the blocks, not if it should affect the blocks.

just throwing a little hint out there ;)

exactly !

I originally wrote something like
Quote
What does Tim's code do to the blocks.?
but I have been accused of being rude or blunt to Andrea in the past, so I changed it to :
Quote
What do you think Tims code should do to the blocks Andrea ?





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.

M-dub

  • Guest
Re: text style replacement
« Reply #44 on: January 07, 2007, 08:54:59 PM »
but I have been accused of being rude or blunt to Andrea in the past, so I changed it to :

Guilty as charged.  :oops:

My mistake and my apologies   :-)