• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Electrical

    Reply
    Valued Contributor
    Posts: 74
    Registered: ‎04-24-2012
    Accepted Solution

    sheet number lisp rotine help

    194 Views, 2 Replies
    12-04-2012 06:56 AM

    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

    Please use plain text.
    Valued Contributor
    Posts: 74
    Registered: ‎04-24-2012

    Re: sheet number lisp rotine help

    12-04-2012 08:50 AM in reply to: acade2012

    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?

    Please use plain text.
    Valued Contributor
    Posts: 74
    Registered: ‎04-24-2012

    Re: sheet number lisp rotine help

    12-04-2012 11:17 AM in reply to: acade2012

    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:smileyfrustrated: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) )

     

     

    Please use plain text.