HFB Posted July 26 Share Posted July 26 Hi. I am getting my head around the sheet set manager, and have been using fields to reference different sheets numbers. I've broken some links at some point and have no problem fixing them, I just would like to know if there is a quick way to select all the MTEXT objects that contain fields. If I could narrow it down to ones that are broken (displaying ##), that would be even better. Prefer something simple, but am starting to use Lisps now that there are starting to be some LT useable ones. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 27 Share Posted July 27 Doing a google found an answer by the great Lee-mac. ;; Field Code - Lee Mac ;; Returns the field expression associated with an object. (defun LM:FieldCode ( en / fd id ) (cond ( (and (wcmatch (cdr (assoc 0 (setq en (entget en)))) "TEXT,MTEXT,ATTRIB") (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)) ) ) ) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
HFB Posted July 28 Author Share Posted July 28 On 7/27/2024 at 12:48 PM, BIGAL said: Doing a google found an answer by the great Lee-mac... Thanks for that, but when I run it (after editing to change LM: to c:), I just get "too few arguments". I even went straight to LM's site and copied straight from there (slightly different to the version you've pasted) and get the same result. I've tried selecting everything before running, just in case that made a difference. I am running AutoCAD LT 2024. Bearing in mind that lisps have only been useable in LT in the last year, I have very little knowledge of what sort of outcome I should expect from the code, so I can't even stare at it until I get an epiphany of where the problem might be... Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 29 Share Posted July 29 You load the defun then need to call the defun. (defun LM:FieldCode ( en / fd id ) ......... ......... ) (LM:FieldCode (car (entsel "\nPick an entity for field check "))) Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 29 Share Posted July 29 AutoCAD 2024 LT will not run VLISP. (just a tip, if you see (vl-load-com), VL, among other things, it's VLISP) Lee Mac's Code is VLISP. Quote Link to comment Share on other sites More sharing options...
HFB Posted July 30 Author Share Posted July 30 (edited) 15 hours ago, SLW210 said: AutoCAD 2024 LT will not run VLISP. (just a tip, if you see (vl-load-com), VL, among other things, it's VLISP) Lee Mac's Code is VLISP. Thanks for the heads up on that one. I did think it odd that it had LM: instead of c : Edited July 30 by HFB c: autocorrected to smiley face Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 30 Share Posted July 30 LM: just stands for LeeMac, Possibly look at AutoLISP sites for learning, you might be able to come up with a non=VLISP solution. IIRC there are DXF codes for fields, but I am not sure how much an AutoLISP code can manipulate fields. AfraLISP would be a good place to start. I am not at work today, but if no one jumps in, I'll try to find time tomorrow. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted July 30 Share Posted July 30 There was a frequent member on here that used pre-LISP AutoCAD LT and did a lot of customization, mostly using Excel and maybe Diesel. Browse through the AutoCAD LT section. Quote Link to comment Share on other sites More sharing options...
HFB Posted August 5 Author Share Posted August 5 (edited) On 7/30/2024 at 11:16 PM, SLW210 said: There was a frequent member on here that used pre-LISP AutoCAD LT and did a lot of customization, mostly using Excel and maybe Diesel. Browse through the AutoCAD LT section. I will do that when I get a chance. I don't have a lot of spare time for creating/searching stuff at work, unfortunately. Edited August 5 by HFB minor amend Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.