santoshkadamat Posted August 29, 2013 Posted August 29, 2013 Hi, I have a drawing template with a title block containing attributes title1, title2, title3, title4, title5, dwg1 and dwg2. I need to map title1, title2, title3, title4, title5 to title description and dwg1, dwg2 to DWgdesc in TEAMCENTER (PLM software). So I need to write an autolisp programme for creating two new attributes in my drawing template i.e titledesc and dwgdesc and add them into my existing title block. After that I need to concatenate title(1 to 5) into titledesc and dwg(1 to 2) to dwgdesc attribute. Please help regarding this issue. Quote
Bhull1985 Posted August 29, 2013 Posted August 29, 2013 (defun c:aaa ( / blkss att val vallst tag a b) (setq blkss (ssget "_X" '((2 . "TITLEATTRIBUTES")))) (setq ATT (ssname blkss 0)) (setq ATT (entnext ATT)) (while (= (cdr (assoc 0 (entget (setq att (entnext att))))) "ATTRIB") (setq val (cdr (assoc 1 (entget att))) vallst (cons val vallst))) (setq tag (nth 1 vallst)) (if (=(strlen tag) 1) (progn (setq a (strcat "-0" tag)) )) (if (=(strlen tag) 2) (progn (setq a tag) )) (if ( = (nth 2 vallst) "1") (progn (setq a "-00") )) (setq b (strcat (nth 53 vallst)a)) (command "-attedit" "n" "n" "" "L-CONDWGNO" "" "-" b) ) "titleattributes"=block name you may be able to use and modify this for your needs, though don't cite me on that Quote
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.