AutoCAD Electrical
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
sheet number lisp rotine help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
hello All,
I am tring to develop a lisp routine to change the sheet number to match the last 3 digits of the drawing number.
I have been able to get and write the proper number the the sheet value but it adds it to the existing sheet value.
Can anyone help me with deleting or overwriting that sheet value before i add the correct value??
Thanks
Dennis
(prompt "\nType AAA to run.....")
(defun c:aaa ()
(COMMAND "-ATTEDIT" "N" "N" "WD_M" "SHEET" "" "" (SUBSTR (GETVAR "DWGNAME") (- (STRLEN (GETVAR "DWGNAME")) 6) 3))
(princ) )
the result finds the correct number and adds it to the existing sheet number i need it to overwrite the sheet number
Solved! Go to Solution.
Re: sheet number lisp rotine help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I did notice with the 2nd set of empty "". this is looking for a value to search for and replace. If i put in the current sheet value is changes it correctly.
the issue is that value changes from drawing to drawing.
I tried to get the current sheet value out but I am not having any luck.
i have tried the follwing
SETQ SHTNUM (GET_ATTR "WD_M" "SHEET" )
SETQ SHTNUM (GETVAR SHEET)
ANY IDEAS?
Re: sheet number lisp rotine help
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
HERE IS WHAT I ENDED UP FIGURING OUT
FIRST LINE CLEARS THE SHEET NUMBER AND THE SECOND COPIES THE DRAWING NUMBER (ISTATING AT INTIGER 6 GOING 3 PLACES)
HOPE THIS WILL HELP SOMEONE!!!
(prompt "\nType SHTNUM to run.....")
(defun c
HTNUM ()
(c:wd_modattrval (ssname(ssget "x" (list (cons 0 "insert")(cons 2 "WD_M"))) 0) "SHEET" "" 1) ;CLEARS SHEET VALUE
(COMMAND "-ATTEDIT" "N" "N" "WD_M" "SHEET" "" "" (SUBSTR (GETVAR "DWGNAME") (- (STRLEN (GETVAR "DWGNAME")) 6) 3)) ;SET SHEET VALUE=DWGNAME
(PRINC) )

