Message 1 of 16
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
(defun sb (lyr / e name n out ss)
(vl-load-com)
(if (setq name "BEAM"
ss (ssget "_X" '((0 . "INSERT")(8 . lyr)))
n -1
out (ssadd)
)
(while (setq e (ssname ss (setq n (1+ n))))
(if (= :vlax-true (vla-get-IsDynamicBlock (vlax-ename->vla-object e)))
(if (= (strcase (vla-get-Effectivename (vlax-ename->vla-object e))) (strcase name))
(ssadd e out)
)
)
)
)
(if (/= 0 (sslength out))(sssetfirst nil out)(princ (strcat "No Dynamic Block found by the Name - " name)))
(command "_.draworder" "_back")
(princ)
)
(defun c:BDRAWORDER (/ layerList data ss)
(foreach layer '(
"TEXT"
"DIMENSIONS"
"RAILING"
"0"
"* SHEARWALLS"
"* TEXT *"
"* TEXT - WALL LINES"
"* DIM *"
"* SECTION"
"* ROOF"
"* ROOF BEAMS"
"* ROOF FRAMING"
"* ROOF POSTS"
"* CEILING BEAM"
"* CEILING FRAMING"
"* CEILING POSTS"
"* FRAMING BEAMS"
"* FRAMING"
"* FRAMING POSTS"
"* FND POSTS"
"* SHEARWALLS POSTS"
"* POST"
"* SILL"
"* STEM WALL"
"* FOUNDATION"
"* ELECTRICAL"
"* GAS"
"* WALLS - E"
"* WALLS - I"
"* DOORS"
"* WINDOWS"
"* STAIRS"
"* FP"
"* WALLS - HATCH"
)
(if (setq ss (ssget "_X" (list (cons 8 layer)))) ; layer has objects
(command "_.draworder" ss "" "_back")
(if (= layer "* ROOF FRAMING") (sb "* ROOF BEAMS"))
;(cond ((= layer "* ROOF FRAMING")(sb "* ROOF BEAMS"))
;((= layer "* CEILING FRAMING")(sb "* CEILING BEAM"))
;(t nil)
;)
)
) ; end foreach
(princ)
)
Hi,
The first function "sb" was partially provided by someone on this forum and it just selects all dynamic blocks of a given name. I modified it to select block "BEAM" on whichever layer (lyr) is specified and at the end sets the draworder to back. This all seemed to work when called in the function "BDRAWORDER" until I tried changing (if (= layer "* ROOF FRAMING") (sb "* ROOF BEAMS")) to the cond function thats now commented out.
As soon as "sb" is called, I get Command: ; error: bad SSGET list value and it stops running.
Thanks
Solved! Go to Solution.