Results 1 to 2 of 2

Thread: Custom text justification

  1. #1
    Member
    Join Date
    2001-08
    Posts
    24
    Login to Give a bone
    0

    Default Custom text justification

    Has anyone had any experience with creating justifications based on distance from an object? In other words...

    I want to allow the user to select a specific justification from a dialog or prompt and place the start point of the text "x" distance from the from an object.

    Is this possible?

    J. Logan

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: Custom text justification

    Quote Originally Posted by jlogan02
    Has anyone had any experience with creating justifications based on distance from an object? In other words...

    I want to allow the user to select a specific justification from a dialog or prompt and place the start point of the text "x" distance from the from an object.

    Is this possible?

    J. Logan
    Hi jlogan02,
    What you want maybe like this.
    Code:
    (defun c:test (/ loc str th rot el sse tb len opt tex tex1 just p2)
      (setq loc (getpoint "\nClick any location in drawing area<0,0,0>: "))
      (if (= loc nil)(setq loc '(0 0 0)))
      (setq str "Adesu")
      (setq th 1)
      (setq rot 0)
      (command "_text" loc th "" str rot)
      (setq el (entlast))
      (setq sse (entget el))
      (setq tb (textbox sse))   
      (setq len (caadr tb))
      (initget "R r C c L l")
      (setq opt (getkword "\nSelect option [(r)ight,(c)enter,(l)eft]<c>: "))
      (if (= opt nil)(setq opt "C"))
      (setq tex "\nEnter justification distance from point object: ")
      (setq tex1 (strcat "[current length of text = " (rtos len 2 5) " ]"))
      (command "_erase" el "")
      (cond ((= opt "R")
    	 (progn
    	   (setq just (getdist (strcat tex tex1 "<0>: ")))
    	   (if (= just nil)(setq just '(0)))
    	   (setq p2 (polar loc 0 just))
    	   (command "_text" p2 th "" str rot)
    	   )                                  ; progn
    	 )
    	((= opt "C")
    	 (progn
    	   (setq just (/ len 2.0))
    	   (setq p2 (polar loc pi just))
    	   (command "_text" p2 th "" str rot)
    	   )                                  ; progn
    	 )
    	((= opt "L")
    	 (progn
    	   (setq just (getdist (strcat tex tex1 "<0>: ")))
    	   (if (= just nil)(setq just '(0)))
    	   (setq p2 (polar loc pi just))
    	   (command "_text" p2 th "" str rot)
    	   )                                  ; progn
    	 )
    	)                                     ; cond
      (princ)
      )                                           ; defun

Similar Threads

  1. 2014: ACA - Wall custom justification line?
    By pbe in forum ACA General
    Replies: 2
    Last Post: 2014-06-23, 02:42 PM
  2. 2012: UN-justification of text
    By Martin Figlarz in forum Revit Architecture - General
    Replies: 0
    Last Post: 2011-12-01, 08:55 PM
  3. Text Justification DWF to PDF
    By JohnnyFortune in forum Revit - Plotting/Printing/Exporting
    Replies: 2
    Last Post: 2009-11-06, 12:37 AM
  4. Replies: 0
    Last Post: 2008-01-31, 09:15 PM
  5. Text justification
    By barathd in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2004-09-28, 04:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •