Title Block Revision
Hello all,
I have a LISP for adding revisions to a title block that I need help with making work in BricsCAD.
I was able to modify the LISP and have it work with one exception. I can't seem to get the Attribute editor to select the "REVISION" block. It instead, it wants to edit the "TITLE BLOCK".
AutoCAD LISP:
;insert TitleBlock revision
(defun C:REV(/ L OS PT SS TB)
;(rtzstr)
(setq OS (getvar "OSMODE") L (getvar "CLAYER"));get current layer & snap settings
(if (= (getvar "CTAB") "Model");get to a tab & into paper space
(progn
(command "-layout" "s" "")
(command "pspace")
)
(command "pspace")
)
(command "zoom" "w" "15.125,7.1875" "16.625,2.4375");zoom to revision area
(setvar "CLAYER" "0")
(setvar "OSMODE" 32)
(setq PT (getpoint "\nREVISION\nSelect Row Insert Point:"))
(setvar "OSMODE" 0)
(command "-insert" "REVISION" "s" "1" PT "0" (DATE?));insert revision block & call DATE? function
(setq SS (ssget "L"))
(initdia)(command "attedit" "l")
(command "zoom" "extents");(zoom so titleblock can be sent to refedit)
(command "-refedit" "0.125,0.125" "O" "A" "N")
(command "refset" "a" (ssname SS 0) "");add revision block to titleblock reference
(command "refclose" "s")
(command "zoom" "previous")
(setvar "OSMODE" OS)
(setvar "CLAYER" L)
;(rtzexit)
;check for goofy linetype
(if (tblsearch "LTYPE" "{ Half Dash }")
(alert "Goofy Linetype detected.\nPlease see Brian")
)
(princ)
)
BricsCAD LISP:
;insert TitleBlock revision
(defun C:REV(/ L OS PT SS TB)
;(rtzstr)
(setq OS (getvar "OSMODE") L (getvar "CLAYER"));get current layer & snap settings
(if (= (getvar "CTAB") "Model");get to a tab & into paper space
(progn
(command "layout" "s" "")
(command "pspace")
)
(command "pspace")
)
(command "zoom" "w" "15.125,7.1875" "16.625,2.4375");zoom to revision area
(setvar "CLAYER" "0")
(setvar "OSMODE" 32)
(setq PT (getpoint "\nREVISION\nSelect Row Insert Point:"))
(setvar "OSMODE" 0)
(command "-insert" "REVISION" "s" "1" PT "0" (DATE?));insert revision block & call DATE? function
(setq SS (ssget "L"))
(initdia)(command "eattedit" "1")
(command "zoom" "extents");(zoom so titleblock can be sent to refedit)
(command "-refedit" "0.125,0.125" "O" "A" "N")
(command "refset" "a" (ssname SS 0) "");add revision block to titleblock reference
(command "refclose" "s")
(command "zoom" "previous")
(setvar "OSMODE" OS)
(setvar "CLAYER" L)
;(rtzexit)
;check for goofy linetype
(if (tblsearch "LTYPE" "{ Half Dash }")
(alert "Goofy Linetype detected.\nPlease see Brian")
)
(princ)
)
Thank you for your time.
Dru
I have a LISP for adding revisions to a title block that I need help with making work in BricsCAD.
I was able to modify the LISP and have it work with one exception. I can't seem to get the Attribute editor to select the "REVISION" block. It instead, it wants to edit the "TITLE BLOCK".
AutoCAD LISP:
;insert TitleBlock revision
(defun C:REV(/ L OS PT SS TB)
;(rtzstr)
(setq OS (getvar "OSMODE") L (getvar "CLAYER"));get current layer & snap settings
(if (= (getvar "CTAB") "Model");get to a tab & into paper space
(progn
(command "-layout" "s" "")
(command "pspace")
)
(command "pspace")
)
(command "zoom" "w" "15.125,7.1875" "16.625,2.4375");zoom to revision area
(setvar "CLAYER" "0")
(setvar "OSMODE" 32)
(setq PT (getpoint "\nREVISION\nSelect Row Insert Point:"))
(setvar "OSMODE" 0)
(command "-insert" "REVISION" "s" "1" PT "0" (DATE?));insert revision block & call DATE? function
(setq SS (ssget "L"))
(initdia)(command "attedit" "l")
(command "zoom" "extents");(zoom so titleblock can be sent to refedit)
(command "-refedit" "0.125,0.125" "O" "A" "N")
(command "refset" "a" (ssname SS 0) "");add revision block to titleblock reference
(command "refclose" "s")
(command "zoom" "previous")
(setvar "OSMODE" OS)
(setvar "CLAYER" L)
;(rtzexit)
;check for goofy linetype
(if (tblsearch "LTYPE" "{ Half Dash }")
(alert "Goofy Linetype detected.\nPlease see Brian")
)
(princ)
)
BricsCAD LISP:
;insert TitleBlock revision
(defun C:REV(/ L OS PT SS TB)
;(rtzstr)
(setq OS (getvar "OSMODE") L (getvar "CLAYER"));get current layer & snap settings
(if (= (getvar "CTAB") "Model");get to a tab & into paper space
(progn
(command "layout" "s" "")
(command "pspace")
)
(command "pspace")
)
(command "zoom" "w" "15.125,7.1875" "16.625,2.4375");zoom to revision area
(setvar "CLAYER" "0")
(setvar "OSMODE" 32)
(setq PT (getpoint "\nREVISION\nSelect Row Insert Point:"))
(setvar "OSMODE" 0)
(command "-insert" "REVISION" "s" "1" PT "0" (DATE?));insert revision block & call DATE? function
(setq SS (ssget "L"))
(initdia)(command "eattedit" "1")
(command "zoom" "extents");(zoom so titleblock can be sent to refedit)
(command "-refedit" "0.125,0.125" "O" "A" "N")
(command "refset" "a" (ssname SS 0) "");add revision block to titleblock reference
(command "refclose" "s")
(command "zoom" "previous")
(setvar "OSMODE" OS)
(setvar "CLAYER" L)
;(rtzexit)
;check for goofy linetype
(if (tblsearch "LTYPE" "{ Half Dash }")
(alert "Goofy Linetype detected.\nPlease see Brian")
)
(princ)
)
Thank you for your time.
Dru
0
Comments
-
Why not make the revisions part of the title block rather than adding or have a multi line revision block. I have a bump revisions.lsp when they are full eg adding 6th revision to a 5 revision attribute block.0
-
You could get a selection set of all inserts and loop over them until you find them:
(setq SSblocks (ssget "_X" '((0 . "INSERT"))))
(repeat (sslength ssblocks)
(progn
(if (setq eblock (ssname ssblocks 0))
(progn
(print eblock)
(print (entget eblock))
(setq bname (cdr (assoc 2 (entget eblock))))
(print bname)
(command "-bedit" bname)
(replacefields)
(command "Bclose" "save")
(princ)
)
)
(ssdel eblock ssblocks)
)
)0