Trai Posted August 26, 2021 Posted August 26, 2021 I usually do with block in drawings. I see that ''REFEDIT'' command choosing can also work but it takes longer time, so can someone help me a lisp to result this problem. Thanks all Quote
tombu Posted August 27, 2021 Posted August 27, 2021 T.Willey's code at TheSwamp may be what you're looking for https://www.theswamp.org/index.php?topic=12437.msg153343#msg153343 1 Quote
Trai Posted August 27, 2021 Author Posted August 27, 2021 36 minutes ago, tombu said: T.Willey's code at TheSwamp may be what you're looking for https://www.theswamp.org/index.php?topic=12437.msg153343#msg153343 DEAR SIR. i read link you pined and find a lisp, but lisp only permiss click to delete object . can you help me edit it to i can sweep many objects, ''NOT'' click mouse to delete. Here code lisp. (defun c:EraseObjectFromBlock (/ ActDoc BlkCol Sel Ent) ; Erase object selected from block, in block collection, so all blocks will update. (setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object))) (vla-EndUndoMark Actdoc) (vla-StartUndoMark ActDoc) (setq BlkCol (vla-get-Blocks ActDoc)) (setvar "errno" 0) (while (not (equal (getvar "errno") 52)) (if (and (setq Sel (nentsel "\n Select nested object to erase from block: ")) (> (length Sel) 2) (not (vl-position nil (mapcar '(lambda (x / BlkName BlkObj) (setq BlkName (cdr (assoc 2 (entget x)))) (and (not (vl-catch-all-error-p (setq BlkObj (vl-catch-all-apply 'vla-Item (list BlkCol Blkname))))) (= (vla-get-IsXref BlkObj) :vlax-false) (= (vla-get-IsLayout BlkObj) :vlax-false) ) ) (last Sel) ) ) ) (/= (cdr (assoc 0 (entget (setq Ent (car Sel))))) "ATTRIB") ) (progn (vla-Delete (vlax-ename->vla-object Ent)) (vla-Regen ActDoc acActiveViewport) ) (prompt "\n Object selected can not be erased with this command.") ) ) (vla-EndUndoMark ActDoc) (princ) ) Quote
tombu Posted August 27, 2021 Posted August 27, 2021 9 hours ago, Trai said: DEAR SIR. i read link you pinned and find a lisp, but lisp only permits click to delete object . can you help me edit it to i can sweep many objects, ''NOT'' click mouse to delete. Here code lisp. nentsel (AutoLISP) https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-A7AC0917-66CE-4BAA-BBAF-D49F8ADB26B1 Prompts the user to select an object (entity) by specifying a point, and provides access to the definition data contained within a complex object As nentsel which is used to select the entity inside the block can only select one object at a time you're going to have to use the BEDIT command to do that. Quote
tombu Posted August 31, 2021 Posted August 31, 2021 See also https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quickly-remove-objects-on-block-with-swept-selected-object/td-p/10587956 Quote
Jonathan Handojo Posted September 2, 2021 Posted September 2, 2021 If you delete an object in the block, wouldn't you delete that object across all other blocks in the drawing? Quote
ronjonp Posted September 4, 2021 Posted September 4, 2021 On 9/2/2021 at 12:29 AM, Jonathan Handojo said: If you delete an object in the block, wouldn't you delete that object across all other blocks in the drawing? Yessir .. simple example: (if (setq e (car (nentsel))) (vla-delete (vlax-ename->vla-object e)) ) Quote
masterfal Posted September 12, 2021 Posted September 12, 2021 (edited) to edit blocks in place i use this: (defun c:ED () (command "-refedit" "O" "" "")) then to exit i use this: (defun c:EDX () (command "refCLOSE" "" "")) skips all the additional dialog that pops up. just ensure the block you want to edit is highlighted before running ED command otherwise message about selecting nesting level will pop up. with those keys so close to each other on keyboard once get use to it you can jump in/out of blocks really quickly Edited September 12, 2021 by masterfal Quote
tombu Posted September 13, 2021 Posted September 13, 2021 18 hours ago, masterfal said: to edit blocks in place i use this: skips all the additional dialog that pops up. just ensure the block you want to edit is highlighted before running ED command otherwise message about selecting nesting level will pop up. with those keys so close to each other on keyboard once get use to it you can jump in/out of blocks really quickly This refedit toggle command allows you to select the block before or after the command. When finished just use the same command to exit. (defun c:REDT () (if(=(strlen(getvar 'refeditname))0) (progn (sssetfirst nil(ssget "_:S" '((0 . "INSERT")))) (command "-refedit" "O" "" "") ) (command "refCLOSE" "" "") ) (princ) ) Of course the Ribbon gives you the options to save or discard changes as well as adding or removing from the working set. Quote
masterfal Posted September 14, 2021 Posted September 14, 2021 23 hours ago, tombu said: This refedit toggle command allows you to select the block before or after the command. When finished just use the same command to exit. (defun c:REDT () (if(=(strlen(getvar 'refeditname))0) (progn (sssetfirst nil(ssget "_:S" '((0 . "INSERT")))) (command "-refedit" "O" "" "") ) (command "refCLOSE" "" "") ) (princ) ) Of course the Ribbon gives you the options to save or discard changes as well as adding or removing from the working set. ohh nice! love finding better ways to do things. i use keyboard shortcuts for everything so i dont use ribbon or icons. i like using as much drawing space on my screen as possible. plus i find it much quicker to use keyboard rather than moving mouse to click icon. used to work with this older guy who only wanted to use icons as he thought he couldn't remember so many shortcuts. be surprised how quickly you learn them when using regularly though Quote
tombu Posted September 14, 2021 Posted September 14, 2021 10 hours ago, masterfal said: ohh nice! love finding better ways to do things. i use keyboard shortcuts for everything so i don't use ribbon or icons. i like using as much drawing space on my screen as possible. plus i find it much quicker to use keyboard rather than moving mouse to click icon. used to work with this older guy who only wanted to use icons as he thought he couldn't remember so many shortcuts. be surprised how quickly you learn them when using regularly though There's at least 200 AutoCAD commands alone and for those of us using verticals adding Map, Civil, Render, Vehicle Tracking more than triples that amount. I've got access to hundreds of them along with another hundred lisp functions in a well organized heavily customized cuix Ribbon with 33 Shortcut Menus. Old guy here who only uses about 30 keyboard shortcuts on a regular basis. Haven't used Toolbars in years as just one Ribbon Tab displaying 12 Panels with each able to provide access to a hundred commands makes having an old fashion Toolbar a waste of screen space. I do use my QAT a lot since it's visible no matter what Panel is selected for Undo/Redo, Layer List Combo Box, etc… https://xlncad.com/complete-list-of-autocad-commands/ Quote
BIGAL Posted September 15, 2021 Posted September 15, 2021 (edited) Those of us old enough remember digitisers and all the commands you could put on them and a 4 button puck. There is a sample dwg somewhere, this is a panel for the digitiser. There are multi panels on the digitiser. Watching experienced users was super fast and they did not look at digitiser just knew where a command was. Edited September 15, 2021 by BIGAL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.