(defun C:BEAM (/ CRlayr CRecho *error* pt1 pt2)
(setq CRlayr (getvar "CLAYER"))
(setq CRecho (getvar "CMDECHO"))
;-------------------------------------------------------------------------
(setq *error* ;;;resets sysvar incase of
(lambda (msg) ;;;an error, esc, exit, cancel
(setvar "CMDECHO" CRecho)
(setvar "CLAYER" CRlayr)
(princ msg)
(princ)))
;---------------------------------------------------------------
(setvar "CMDECHO" 0)
(if
(= (tblsearch "layer" "S-STEL-BEAM") nil)
(vl-cmdf "_.layer" "new" "S-STEL-BEAM" "color" "4" "S-STEL-BEAM" "set" "S-STEL-BEAM" "")
(setvar "CLAYER" "S-STEL-BEAM")
);if
(if
(= (tblsearch "block" "_Beam") nil)
(progn
(command "_.insert" "_Beam" nil);;;;
I figure if this block is not inuse the others have not been inserted either. I will probably chage this area and run a check for each block
(command "_.insert" "_BoxBlank" nil)
(command "_.insert" "_DatumBlank" nil)
(command "_.insert" "_DatumFilled" nil)
(command "_.insert" "_Dot" nil)
);prong
);if
(if
(= (tblsearch "dimstyle" "LPAS-BEAM") nil)
(progn
(vl-cmdf "_.dimstyle" "restore" "Standard")
(_beam_setup);;;;;runs subroutine to set dimvars
(vl-cmdf "_.dimstyle" "save" "LPAS-BEAM")
)
(vl-cmdf "_.dimstyle" "restore" "LPAS-BEAM")
);if
(setq pt1 (getpoint "\nSelect start of beam: "))
(setq pt2 (getpoint "\nSlect end of beam: " pt1))
;(setvar "CLAYER" "S-STEL-BEAM")
(vl-cmdf "_.dimstyle" "r" "LPAS-BEAM")
(vl-cmdf "_.dimaligned" pt1 pt2 "t" " " pt1)
(setvar "CLAYER" CRlayr)
(setvar "CMDECHO" CRecho)
(princ)
)
Bookmarks