Good day to you,
I have made a script, part lisp, to read the value of a block in my sheets. I need this to put it into the value for another block that holds the backward referencing (the current sheet name)
This one is working but I need something additional:
to read only part of the string and setq it.
for instance:
A2.203.2 is my sheet name. The 03 tells what sector the sheet is indicating. So for multiple sheets this would be a variable value. I need to get my lisp to understand that it's reading only part of the value and not all of it.
Anyone?
Regards,
David
Code:
;Returns Attribute value
(defun GetAtt (BLOCK TAG / sset cnt ent1 ent2 entinfo name)
(if
(setq sset
(ssget "x"
(list
(cons 2 block)
)
)
)
(progn
(setq cnt 0)
(setq ent1
(ssname sset cnt)
)
(setq ent2
(entnext ent1)
)
(setq entinfo
(entget ent2)
)
(while
(and ent2
(= "ATTRIB"
(cdr
(assoc 0 entinfo)
)
)
)
(if
(= tag
(cdr
(assoc 2 entinfo)
)
)
(progn
(setq name (cdr (assoc 1 entinfo)))
(setq ent2 nil)
)
(progn
(setq ent2 (entnext ent2))
(setq entinfo (entget ent2))
)
)
)
)
)
name
)
(setq this_sheet (getatt "30x42bdr-att_2006" "SHEET_NUMBER"))
(command "-attedit"
"NO"
"NO"
"sect_up_iden"
"BWD_REF"
"*"
"BWD_REF"
this_sheet
)
(command "-attedit"
"NO"
"NO"
"sect_rt_iden"
"BWD_REF"
"*"
"BWD_REF"
this_sheet
)
TCASE
ALL
UPPER
ZOOM
EXTENTS
-PURGE
ALL
*
NO
[ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]