Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm looking to erase all objects within a selected block using the (vla-delete) method and then draw a vertical line within the block.
Code:
(defun c:EraseAll ()
(vl-load-com)
(setq ACAD_Obj (vlax-get-acad-object)
ACAD_Doc (vla-get-ActiveDocument ACAD_Obj)
ACAD_Blocks (vla-get-Blocks ACAD_Doc)
)
(setq Block_Selection (vlax-ename->vla-object (car (entsel "\nSelect Block: ")))
Block_Name (vla-get-effectivename Block_Selection)
Block (vla-item ACAD_Blocks Block_Name)
)
(vla-delete "Selection Set")
(vla-AddLine Block (vlax-3d-point 0 0 0) (vlax-3d-point 0 50 0))
(vla-Regen ACAD_Doc acALLViewports)
(princ)
)
This is just a snippet from the actual code and is used as an example of what I'm trying to achieve. Where I'm stuck is what to include in the "Selection Set" to only select the objects within the block.
Essentially what trying to accomplish is the equivalent of doing:
(command "-BEDIT" Block_Name
"_ERASE" "ALL" ""
"_BCLOSE" "S"
)
Solved! Go to Solution.