Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/2020 in all areas

  1. Two versions of the above, one using VL the other plain, take your pick. Point is inserted on the current layer. (defun c:TEST1 (/ c_doc c_spc sel data z pt) (vl-load-com) (setq c_doc (vla-get-activedocument (vlax-get-acad-object)) c_spc (vlax-get-property c_doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)) ) (cond ( (and (setq sel (entsel "\nSelect Text : ")) (wcmatch (cdr (assoc 0 (setq data (entget (car sel))))) "*TEXT") ) (setq z (distof (cdr (assoc 1 data)))) (cond ( (and z (setq pt (getpoint "\nSelect Point placement : "))) (setq pt (reverse (cons z (cdr (reverse pt))))) (vlax-invoke c_spc 'addpoint pt) ) (t (alert "Selected text is not a number.")) ) ) (t (alert "\nSelected object is not a text or mtext.")) ) (princ) ) (defun c:TEST2 (/ sel data z pt) (cond ( (and (setq sel (entsel "\nSelect Text : ")) (wcmatch (cdr (assoc 0 (setq data (entget (car sel))))) "*TEXT") ) (setq z (distof (cdr (assoc 1 data)))) (cond ( (and z (setq pt (getpoint "\nSelect Point placement : "))) (setq pt (reverse (cons z (cdr (reverse pt))))) (command "_.point" pt) ) (t (alert "Selected text is not a number.")) ) ) (t (alert "\nSelected object is not a text or mtext.")) ) (princ) )
    1 point
  2. Knowing master Lee he often uses roamable prefix. Looking at his code : (defun _GetSavePath ( / tmp ) (cond ( (setq tmp (getvar 'ROAMABLEROOTPREFIX)) (strcat (vl-string-right-trim "\\" (vl-string-translate "/" "\\" tmp)) "\\Support") ) ( (setq tmp (findfile "ACAD.pat")) (vl-string-right-trim "\\" (vl-string-translate "/" "\\" (vl-filename-directory tmp))) ) ( (vl-string-right-trim "\\" (vl-filename-directory (vl-filename-mktemp))) ) ) ) in this case (getvar 'ROAMABLEROOTPREFIX) gives a folder and added is a subfolder \Support so it could be something like : folder : c:\Users\rlx\AppData\Roaming\Autodesk\AutoCAD 2017\R21.0\enu\Support\ files : LMAC_BFind_V2-0.cfg LMAC_BFind_SavedSearches_V2-0.txt
    1 point
×
×
  • Create New...