Jump to content

Recommended Posts

Posted

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.

Posted

(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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...