Shift the overlapping text to right side

Shift the overlapping text to right side

arshadmirza786
Collaborator Collaborator
843 Views
8 Replies
Message 1 of 9

Shift the overlapping text to right side

arshadmirza786
Collaborator
Collaborator

Attached PRL.lsp help to write the value of X,Y at desired place problem is when a line is in vertical steps, the 2 values are overlapped and has a labour work to shift the each value to left or right

 

Can any one help to improve, the value overlapping be shifted as per text height to left or right for improving readability thanks  

0 Likes
844 Views
8 Replies
Replies (8)
Message 2 of 9

CADaSchtroumpf
Advisor
Advisor

Try to replace function WRITE-VERTICES by this

(defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR)
(setq httt "0.1") 
(setq gptx (getpoint "\nBasepoint for X axis: "))
(setq gpty (getpoint "\nBasepoint for Y axis: "))
(setvar "lastpoint" gptx)
   (foreach ITEM NEWVLIST
      (setq XSTR (rtos (nth 0 ITEM) 2 2)
            YSTR (rtos (nth 1 ITEM) 2 3)
            ZSTR (rtos (nth 2 ITEM) 2 3)
            STR  (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat
      ) ; setq
;      (write-line STR F1)
 
(if (> (+(atof xstr)(/ (atof httt) 2.0)) (+ (car (getvar "lastpoint")) (atof httt)))
  (progn
    (command "_text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gptx)) httt "90" (strcat xstr))
    (command "_text" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gpty)) httt "90" (strcat ystr))
    (setvar "lastpoint" (list (+(atof xstr)(/ (atof httt) 2.0)) (cadr gptx)))
  )
  (progn
    (command "_text" (list (+ (car (getvar "lastpoint")) (atof httt)) (cadr gptx)) httt "90" (strcat xstr))
    (command "_text" (list (+ (car (getvar "lastpoint"))) (cadr gpty)) httt "90" (strcat ystr))
    (setvar "lastpoint" (list (+ (car (getvar "lastpoint")) (atof httt)) (cadr gptx)))
  )
)
   ) ; foreach

) ; write-vertices

PS: I have change the variable httt to "0.1" (before "1.75") to according at your drawing

0 Likes
Message 3 of 9

arshadmirza786
Collaborator
Collaborator

1-    Sorry it start "Text" command after loading the lisp,          afterword does not start with "PRL" may be copy               paste error

'2-    text height =(3x scale of model) in my case 3x750             =2.25 instead of 0.1 that's better

'

0 Likes
Message 4 of 9

calderg1000
Mentor
Mentor

Regards  @arshadmirza786 

In the PRL2 file, you have some other lines that I have commented on. Also add "none" in the Text command in case you have Osnap activated.
I suppose you have in mind to activate F11, before executing the routine

 

calderg1000_0-1634991773138.png

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 5 of 9

CADaSchtroumpf
Advisor
Advisor

You have make a bad copy-paste

0 Likes
Message 6 of 9

arshadmirza786
Collaborator
Collaborator

 @calderg1000

Thank you foe helping 

1- X value read from WCS 0,0,0 instead of Start of Line X = 0

2- Text spacing is double the text height, Pls make it single space

Thanks

0 Likes
Message 7 of 9

calderg1000
Mentor
Mentor

Hello @arshadmirza786 

Make the change indicated on the highlighted line. The other change I do not interpret well, if possible attach an image as it should be.

Regards.

 

calderg1000_0-1635080649897.png

 


Carlos Calderon G
EESignature
>Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

0 Likes
Message 8 of 9

CADaSchtroumpf
Advisor
Advisor

Change (without bad copy-paste) 😉 the function WRITE-VERTICES

(defun WRITE-VERTICES (NEWVLIST / XSTR YSTR ZSTR STR)
(setq httt "2.25") 
(setq gptx (getpoint "\nBasepoint for X axis: "))
(setq gpty (getpoint "\nBasepoint for Y axis: "))
(setvar "lastpoint" (car NEWVLIST))
   (foreach ITEM NEWVLIST
      (setq XSTR (rtos (nth 0 ITEM) 2 2)
            YSTR (rtos (nth 1 ITEM) 2 3)
            ZSTR (rtos (nth 2 ITEM) 2 3)
            STR  (strcat XSTR (SPACES XSTR) YSTR (SPACES YSTR) ZSTR) ;_ strcat
      ) ; setq
;      (write-line STR F1)

(if (> (+ (car (getvar "lastpoint")) (atof httt)) (atof xstr))
  (setvar "lastpoint" (list (+ (car (getvar "lastpoint")) (atof httt)) (cadr gptx)))
  (setvar "lastpoint" (list (atof xstr) (cadr gptx)))
)
    (command "_text" "_none" (list (car (getvar "lastpoint")) (cadr gptx)) httt "90" (strcat xstr))
    (command "_text" "_none" (list (car (getvar "lastpoint")) (cadr gpty)) httt "90" (strcat ystr))
   ) ; foreach

) ; write-vertices
0 Likes
Message 9 of 9

arshadmirza786
Collaborator
Collaborator

@calderg1000 

Next dwg is where we start the original PRL 

Pls advise

0 Likes