nestedblock to by block

nestedblock to by block

jim78b
Enthusiast Enthusiast
239 Views
2 Replies
Message 1 of 3

nestedblock to by block

jim78b
Enthusiast
Enthusiast

i have this lisp and i want work with nested blocks, now don't work with them.please help me. thanks

(defun C:BlkEdit (/ Drawing ent blk)
  (vl-load-com)
  (setq Drawing (vla-get-activedocument (vlax-get-acad-object)))
  (if (/= (getvar 'refeditname) "")
    (progn
      (setq blk (vla-item (vla-get-blocks Drawing) (getvar 'refeditname)))
      (vl-cmdf "_.Refclose" "S")
      (vlax-for x blk
        (vla-put-Color x 6)
      )
      (vla-Regen Drawing acAllViewports)
    )
    (progn
      (if (eq (cdr (assoc 0 (setq ent (entget (car (entsel "\nSelect Blocks")))))) "INSERT")
        (progn
          (setq blk (vla-item (vla-get-blocks Drawing) (cdr (assoc 2 ent))))
          (vlax-for x blk
            (vla-put-Color x 256)
          )
          (sssetfirst nil (ssadd (cdr (assoc -1 ent))))
          (vl-cmdf "-REFEDIT" "O" "A" "N")
        )
        (Prompt "\nNothing Selected")
      )  
    )
  )
  (princ)
)

 

0 Likes
240 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant

SETBYLAYER command can fix nested objects.

0 Likes
Message 3 of 3

jim78b
Enthusiast
Enthusiast

no i want use this for other things, please correct the lisp so will work with nested blocks

0 Likes