- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am still very new to LISP but I am attempting to deliver a program that will:
- Prompt the user to select either one (not not both) of the attribute blocks in the attached drawing file.
- Prompt the user to choose to update the DESNDATE field, the DRAWDATE field, or both.
- Update the chosen fields with the current date in MM/DD/YY format.
Quite literally, the only portion I have had success with is using the print function to prompt the user, and ssget for selecting the block. But I am going in circles trying to figure out the rest.
I found the Attribute Functions on @Lee_Mac 's website, which from what I have seen are quite popular for this purpose, but after endless trial and error, I remained confused as to exactly which parts of the code I need to replace/update to fit my particular needs.
;; Set Attribute Values - Lee Mac ;; Sets attributes with tags found in the association list to their associated values. ;; blk - [ent] Block (Insert) Entity Name ;; lst - [lst] Association list of ((<tag> . <value>) ... ) ;; Returns: nil (defun LM:setattributevalues ( blk lst / enx itm ) (if (and (setq blk (entnext blk)) (= "ATTRIB" (cdr (assoc 0 (setq enx (entget blk)))))) (if (setq itm (assoc (cdr (assoc 2 enx)) lst)) (progn (if (entmod (subst (cons 1 (cdr itm)) (assoc 1 (reverse enx)) enx)) (entupd blk) ) (LM:setattributevalues blk lst) ) (LM:setattributevalues blk lst) ) ) )
I know it's a huge ask and frankly I wouldn't blame you if you'd rather I tough this out pouring over references for the learning experience, but I have users who would really appreciate having this functionality right now.
Kindest Regards and Deepest Gratitude,
Pete
Solved! Go to Solution.