Jump to content

hello, any one can help me make multiple leader match same angle


mikewong0719

Recommended Posts

On 6/21/2018 at 9:56 PM, hanhphuc said:

 

1.If the Mtext is associative to Leader's end, just move it or modify x-coordinates properties.

 

2.lisp: same method from my previous code, by subsituting middle point (cadr p)

now just modify the end point (last p)

 

 

   

(defun c:test ( /  s e p i a )
(if
[color="red"](and (setq x (getpoint "\nPick side to extend "))[/color]
    (setq s (ssget ":L" '((0 . "LEADER") (-4 . "&=") (76 . 3))))
[color="red"])[/color]

...
...
...

(apply 'append
	   [color="red"]
            (subst (cons (car x) (cdr (last p)))
		  (last p)
		  p
		  )[/color]
	   )

...
...

 

 

 

p/s: if you've learned then you can combine all 3 in 1 :)

Thanks mate, your code work like a charm for me. But it only do with leader has 3 points, can you modify it working with 2 points ?. I has been struggled with leader, is there any code to extend leader (second vertex point or last vertex point, landing in a point) like extend a normal line by choosing an edgeimage.thumb.png.1eec32e864542bfd3c5ba3d2d366d5c7.png

Link to comment
Share on other sites

(defun c:test ( /  s e p i a )
(if
(and (setq x (getpoint "\nPick side to extend "))
     (setq s (ssget ":L" '((0 . "LEADER") (-4 . "&=") (76 . 3))))
)
(repeat	(setq i (sslength s))
  (setq	e (ssname s (setq i (1- i)))
	p (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= 10 (car x))) (entget e)))
	a (angle (car p) (cadr p))
	)
  
  (vlax-put (vlax-ename->vla-object e)
	    'coordinates
	    (apply 'append
		   ;(subst (cons (car x) (cdr (last p)))
		   (subst (cons (car x) (cdr (cadr p)) )
			  (cadr p);(last p)
			  p
			  )
		   )

	    )
  )
(princ "\nNothing?")
)
(princ)
)

 

maybe you edit (assoc 75) value 0 to 1 (hook flag)

 

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

how can I make all the leaders to only 90° ,180°, 270° ,360° 

 

(Points to points only orthomode, like 90°,180°,270°,360°)

 

as attached drawing 

TEST.dwg

Link to comment
Share on other sites

11 hours ago, Ajmal said:

how can I make all the leaders to only 90° ,180°, 270° ,360° 

 

(Points to points only orthomode, like 90°,180°,270°,360°)

 

as attached drawing 

TEST.dwg 78.91 kB · 2 downloads

 

Your code takes the first point of an existing leader and creates a three-point leader using the underlined start and underlined end of the text. 

To make this perpendicular, you would fix the first and third points and move the second point toward the right angle. 

 

Since there can be two points that are perpendicular when two points are fixed, (rectangle) 

You need to find a right angle point located on the extension line from the previously calculated second point.

Link to comment
Share on other sites

  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...