Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/29/2023 in all areas

  1. Can you explain why you want to use Qleader, and not just Leader? Because Qleader is not an Autocad object. Qleader is a command that creates a leader, and separately creates a Mtext. Unlike Mleaser which is 1 object. The MText is actually integrated with the leader in a Mleader. Anyway, ran your code; and the leaders are associated to the object as long as I SNAP to a point (endpoint, midpoint....) of that object. Except that I commented out (temp-osmode-off) and (temp-osmode-reset) which you didn't post here. Just a guess... (temp-osmode-off) is the function that causes the problem. The function name sounds like it turns off OSNAP; just the thing that allows the association Try removing those 2 function calls.
    2 points
  2. I'm delighted to hear that you find the program useful after all these years! Here's a tweak to rotate the text to 0 degrees and change the colour to green: ;; Text 2 Point - Lee Mac 2012 ;; Prompts for a selection of Text and Point entities and moves ;; each Text entity to the nearest (2D distance) Point entity in the set. ;; ;; Retains existing Text elevation. (defun c:txt2pt ( / _textinsertion di1 di2 dxf ent inc ins lst mpt pnt sel txt ) (defun _textinsertion ( elist ) (if (and (zerop (cdr (assoc 72 elist))) (zerop (cdr (assoc 73 elist))) ) (cdr (assoc 10 elist)) (cdr (assoc 11 elist)) ) ) (if (setq sel (ssget "_:L" '((0 . "POINT,TEXT")))) (progn (repeat (setq inc (sslength sel)) (setq ent (entget (ssname sel (setq inc (1- inc))))) (if (eq "POINT" (cdr (assoc 0 ent))) (setq lst (cons (cdr (assoc 10 ent)) lst)) (setq txt (cons (cons (_textinsertion ent) ent) txt)) ) ) (foreach ent txt (setq ins (list (caar ent) (cadar ent))) (if (setq pnt (vl-some '(lambda ( pnt ) (equal ins (list (car pnt) (cadr pnt)) 1e-8)) lst)) (setq lst (vl-remove pnt lst)) (progn (setq di1 (distance ins (list (caar lst) (cadar lst))) mpt (car lst) ) (foreach pnt (cdr lst) (if (< (setq di2 (distance ins (list (car pnt) (cadr pnt)))) di1) (setq di1 di2 mpt pnt ) ) ) (setq pnt (list (car mpt) (cadr mpt) (caddar ent)) dxf (cdr ent) dxf (subst (cons 10 pnt) (assoc 10 dxf) dxf) dxf (subst (cons 11 pnt) (assoc 11 dxf) dxf) dxf (subst '(50 . 0.0) (assoc 50 dxf) dxf) dxf (if (assoc 62 dxf) (subst '(62 . 3) (assoc 62 dxf) dxf) (append dxf '((62 . 3)))) ) (entmod dxf) (setq lst (vl-remove mpt lst)) ) ) ) ) ) (princ) ) (vl-load-com) (princ)
    1 point
  3. Thank you Emmanuel and SLW210 for testing my routine. After SWL suggested I was not snapping I began to think that my routine to turn off snaps was the issue but did not have time to debug yesterday. I guess it only makes sense that to snap to a point osnaps would have to be turned on even during execution of a lisp. I always just thought of osnaps as a drawing aid. Yes Emmanuel I understand your comments about qleader not being a single entity but I prefer the separate mtext/leader object. By the way the leader does have a DXF group code that contains the name of the mtext. I use this relationship in other lisp routines but thank you for your comments. So... problem solved! Thank you all.
    1 point
  4. My Qleaders follow just fine here. Like mentioned, your code isn't snapping.
    1 point
  5. I'm not sure about a LISP but you can draw them as PLINES in the first place.... PELLIPSE System Variable Type: IntegerSaved in: DrawingInitial value: 0 Controls the ellipse type created with ELLIPSE. 0 Creates a true ellipse object. 1 Creates a polyline representation of an ellipse
    1 point
×
×
  • Create New...