Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/21/2024 in all areas

  1. try ;2023/07/31 added Lee Mac routine to carryover the Fields. ;;Added Auto Regen https://www.cadtutor.net/forum/topic/95318-mleader-from-mtext/ ;;Need method to convert text to mtext then to a mleader. (defun c:tt2ml (/ oobj nobj nstrg ad Insertionpoint secondpoint oobj nobj mleader olderr) (vl-load-com) ;Important field extraction code by Lee Mac!! (setq en (vlax-vla-object->ename oobj) ) (defun LM:FieldCode (en / fd id) (cond ((and (wcmatch (cdr (assoc 0 (setq en (entget en)))) "*TEXT" ) (setq en (cdr (assoc 360 en))) (setq en (dictsearch en "ACAD_FIELD")) (setq en (dictsearch (cdr (assoc -1 en)) "TEXT")) (setq fd (entget (cdr (assoc 360 en)))) ) (if (vl-string-search "\\_FldIdx " (cdr (assoc 2 en))) (vl-string-subst (if (setq id (cdr (assoc 331 fd))) (vl-string-subst (strcat "ObjId " (itoa (vla-get-objectid (vlax-ename->vla-object id))) ) "ObjIdx 0" (cdr (assoc 2 fd)) ) (cdr (assoc 2 fd)) ) "\\_FldIdx 0" (cdr (assoc 2 en)) ) (cdr (assoc 2 en)) ) ) ) ); (setq oobj (vlax-ename->vla-object (setq ooe (car (entsel "\nSelect source text: "))) ) ) (setq ad (vla-get-ActiveDocument (vlax-get-acad-object))) (if (or (= (vlax-get-property oobj 'ObjectName) "AcDbMText")(= (vlax-get-property oobj 'ObjectName) "AcDbText") ) ;"AcDbMText" (progn (if (not (setq nstrg (LM:FieldCode (vlax-vla-object->ename oobj))) ) (setq nstrg (vlax-get-property oobj 'TextString)) ) ;if (setq nsextHeight (cdr (assoc 40 (entget ooe)))) (setq InsertionPoint (getpoint "\nPick first point for MLeader: ") ) (setq SecondPoint (getpoint "\nPick next point for text location: ") ) (setq PointList (vlax-make-variant (vlax-safearray-fill (safearray vlax-vbdouble '(0 . 5)) (apply 'append (list InsertionPoint SecondPoint)) ) ) ) (setq mleader (vla-addMLeader (if (= 1 (vla-get-activespace ad)) (vla-get-modelspace ad) (if (= (vla-get-mspace ad) :vlax-true) (vla-get-modelspace ad) (vla-get-paperspace ad) ) ) ;if PointList 0 ) ;vla-addmleader ) ;setq (vlax-put-property mleader 'TextString nstrg) (vlax-put-property mleader 'TextHeight nsextHeight) ;(vla-put-TextHeight dimObj 1) (vla-SetDogLegDirection mleader 0 (vlax-3D-point (list (if (< (car InsertionPoint) (car SecondPoint)) 1 -1 ) 0 0 ) ) ) (entdel (vlax-vla-object->ename oobj)) ;; (prompt "\nFIELDS require a REGEN to update the text.") (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (vla-Regen doc acAllViewports) );progn (progn (princ ;; "\nTry again with a TEXT or MTEXT entity. Press ENTER to try again." "\nTry again with a MTEXT entity. Press ENTER to try again." ) ) ) (princ) )
    1 point
  2. What happens if you format the X&Y columns as numbers will that auto change to comma ? I understand Excel uses comma in some versions. In these 2 lines are the send to Excel could change to strings so the period would be replaced with a comma. (xlsetcelltext row 3 (car (nth 2 val))) (xlsetcelltext row 4 (cadr (nth 2 val))) Please try the format 1st.
    1 point
  3. Like stated, for dimensions only. Did you read the thread I linked?
    1 point
  4. #MeToo has seen common lisp so I think AI had a bad haircut day by using 'let' instead of setq. Elementos is probably spanish or something for member. Asked AI one time to write something for me and the result was far below expectations so no AI for me. A few decades ago microsoft introduced a 'smart' (and super irritating) paperclip and this AI maybe better , unless it reaches 'star trek' level I say get the @#$% of my computer(s)
    1 point
  5. I wrote this program like four years ago (just for fun / exercise) and maybe used it once or twice so as we say here on Mars : guaranteed to the doorstep If it works : , if it doesn't ... As usual never wrote a manual so have fun experimenting. RlxBlockSync.lsp
    1 point
×
×
  • Create New...