Author Topic: Text Width Factor  (Read 4219 times)

0 Members and 1 Guest are viewing this topic.

MeasureUp

  • Bull Frog
  • Posts: 465
Text Width Factor
« on: March 07, 2010, 09:50:59 PM »
By default the width factor of the Text = 1.0
How to change the width factor of an existing Text?
« Last Edit: March 07, 2010, 10:30:01 PM by MeasureUp »

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Text Width Factor
« Reply #1 on: March 08, 2010, 12:31:18 AM »
This is what I have done so far:
Code: [Select]
(defun c:Twidth (/ ExistingText Ent_Twid)
(setq ExistingText (entsel "Select a text to change width: "))
(setq Ent_Twid (entget ExistingText))
(setq Ent_Twid (subst (cons 41 "1.5") (assoc 41 Ent_Twid) Ent_Twid))
(entmod Ent_Twid)
)
What is wrong?
Thanks for your help.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Text Width Factor
« Reply #2 on: March 08, 2010, 12:40:10 AM »
You were very close, only two errors.
Code: [Select]
(defun c:Twidth (/ ExistingText Ent_Twid)
  (setq ExistingText (car (entsel "Select a text to change width: ")))
  (setq Ent_Twid (entget ExistingText))
  (setq Ent_Twid (subst (cons 41 1.5) (assoc 41 Ent_Twid) Ent_Twid))
  (entmod Ent_Twid)
)


Too late here, off to bed. 8-)
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.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Text Width Factor
« Reply #3 on: March 08, 2010, 01:29:14 AM »
You were very close, only two errors.
Code: [Select]
(defun c:Twidth (/ ExistingText Ent_Twid)
  (setq ExistingText (car (entsel "Select a text to change width: ")))
  (setq Ent_Twid (entget ExistingText))
  (setq Ent_Twid (subst (cons 41 1.5) (assoc 41 Ent_Twid) Ent_Twid))
  (entmod Ent_Twid)
)


Too late here, off to bed. 8-)
Thank you very much. Good night.
PS. I am going home, off the work.  ^-^

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Text Width Factor
« Reply #4 on: March 08, 2010, 09:46:59 PM »
You were very close, only two errors.
Code: [Select]
(defun c:Twidth (/ ExistingText Ent_Twid)
  (setq [color=green]ExistingText[/color] ([color=red]car[/color] (entsel "Select a text to change width: ")))
  (setq Ent_Twid (entget ExistingText))
  (setq Ent_Twid (subst (cons 41 1.5) (assoc 41 Ent_Twid) Ent_Twid))
  (entmod Ent_Twid)
)


Too late here, off to bed. 8-)

Another question:
Normally, I can get the contents of the text by using:
Code: [Select]
(setq [color=green]ExistingText[/color] (entsel "Select a text to change width: "))
(getstring (itos ExistingText))
But how to get it with your correction?

Thanks.

rhino

  • Guest
Re: Text Width Factor
« Reply #5 on: March 08, 2010, 10:19:04 PM »
(setq Tvalue (cdr (assoc 1 ExistingText)))

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Text Width Factor
« Reply #6 on: March 08, 2010, 10:48:13 PM »
(setq Tvalue (cdr (assoc 1 ExistingText)))
Thanks but it doesn't work when the lines are inserted to the code:
(defun c:Twidth   (/ ExistingText Ent_Twid Tvalue)
  (setq ExistingText (car (entsel "Select a text to change width: ")))
  (setq Ent_Twid (entget ExistingText))
  (setq Ent_Twid (subst (cons 41 1.5) (assoc 41 Ent_Twid) Ent_Twid))
  (entmod Ent_Twid)
(setq Tvalue (cdr (assoc 1 ExistingText)))
(prompt "Tvalue")

)
« Last Edit: March 08, 2010, 11:05:26 PM by MeasureUp »

MeasureUp

  • Bull Frog
  • Posts: 465
Re: Text Width Factor
« Reply #7 on: March 09, 2010, 01:49:21 AM »
Problem solved.
Thanks to all.

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Text Width Factor
« Reply #8 on: March 09, 2010, 03:30:57 AM »
MeasureUp, you may want to look here or here.