alanjt Posted May 1, 2013 Share Posted May 1, 2013 Great tool as well. Added to toolbar, but I need extension to VVA program, something works exactly like "Isolate Objects" in AutoCAD, but only extension to VVA program. Let say I need to isolate two items from entire dwg, I select them and only this item stay visible and rest of them disappear. Maybe header "Show selected only" is misleading. It s/b "Isolate selected only from entire dwg" Sorry for confusion. I'm confused. You want something that works exactly like "Isolate Objects". Why not just use the Isolate Objects command? Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 1, 2013 Share Posted May 1, 2013 Without reading the rest of the recent posts/code in detail... Methinks they're after a routine that modifies Visible Property (for entities not selected) instead of isolating by layer... Saw a similar discussion recently (think that one was at AUGI in a wish) Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 1, 2013 Share Posted May 1, 2013 Without reading the rest of the recent posts/code in detail... Methinks they're after a routine that modifies Visible Property (for entities not selected) instead of isolating by layer... Saw a similar discussion recently (think that one was at AUGI in a wish) That's exactly what the IsolateObjects command does. It's been in c3d for a long time and has been in core for a while. Quote Link to comment Share on other sites More sharing options...
Guest kruuger Posted May 1, 2013 Share Posted May 1, 2013 Great tool as well. Added to toolbar, but I need extension to VVA program, something works exactly like "Isolate Objects" in AutoCAD, but only extension to VVA program. Let say I need to isolate two items from entire dwg, I select them and only this item stay visible and rest of them disappear. Maybe header "Show selected only" is misleading. It s/b "Isolate selected only from entire dwg" Sorry for confusion. ahh. now understand... Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 1, 2013 Share Posted May 1, 2013 That's exactly what the IsolateObjects command does. It's been in c3d for a long time and has been in core for a while. I misread your post as 'layer isolate' in lieu of 'isolate objects'... My mistake. Yes, IsolateObjects Command in deed does this (yay AECOBJECTISOLATEMODE system variable)... Too bad it does not include, nor honor the LAYISO settings (Off/Fade, etc.). ** ETA - For those who are unfamiliar with IsolateObjects Command, just be mindful of the ObjectIsolationMode system variable. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 1, 2013 Share Posted May 1, 2013 this.Mode = Modes.Rant; ... Reflecting on this more, given the distinction between IsolateObjects, and HideObjects, I am surprised there is not already a "Ctrl" key toggle, as is the case with other Command combinations like Trim / Extend, etc. (think Visibility state changes in Block Editor). Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 1, 2013 Share Posted May 1, 2013 ** ETA - For those who are unfamiliar with IsolateObjects Command, just be mindful of the ObjectIsolationMode system variable. Agreed. Thankfully autocad is nice enough to have a yellow/red lightbulb button at the bottom right. Since they are similar enough, I will post these quick hide and isolate commands. I use these randomly when I want one thing out of my way for a moment. (defun c:HH (/ ss i) ;; temporarily hide pesky objects (regen will bring them back) ;; Alan J. Thompson (if (setq ss (ssget)) (repeat (setq i (sslength ss)) (redraw (ssname ss (setq i (1- i))) 2)) ) (princ) ) (defun c:II (/ tab all ss i e) ;; temporarily isolate selected objects (regen will bring them back) ;; Alan J. Thompson (setq tab (if (eq (getvar 'CVPORT) 1) '(410 . "Model") (cons 410 (getvar 'CTAB)) ) all (ssget "_A" (list tab)) ) (if (setq ss (ssget (list tab))) (repeat (setq i (sslength all)) (redraw (setq e (ssname all (setq i (1- i)))) (if (ssmemb e ss) 1 2 ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 1, 2013 Share Posted May 1, 2013 (edited) Very neat, Alan... Great usage of Redraw, IMO. Here's one called EntFad (EntityFade), which honors one's own LayLockFadeCtrl system variable value: Edit - Forgot to mention, that this supports Model, Layout, and PViewport Active. Edit - Iterating a given Drawing's Model/Paper space Object can be dreadfully slow for large Drawings, especially so using LISP. I may port this to .NET and re-post for those who might benefit from the inherent speed of the latter API. (defun c:ENTFAD () (c:EntityFade)) (defun c:EntityFade (/ fade ss acDoc ignoreList oLayer restoreLayerLockList) (if (and (< 0 (setq fade (getvar 'laylockfadectl))) (>= 90 fade) (setq ss (ssget)) ) (progn (defun bbox:EntityFadeCallback (rea cmd / oLayer restoreLayerLockList) (if (and (wcmatch (strcase (car cmd)) "*CLOSE,*REGEN,*SAVE*,*QUIT") *bbox_EntityFadeReactor* ) (progn (vlr-remove *bbox_EntityFadeReactor*) (foreach item *bbox_RestoreFadeList* (if (= :vlax-true (vla-get-lock (setq oLayer (vla-item (vla-get-layers (vla-get-activedocument (vlax-get-acad-object) ) ) (vla-get-layer x) ) ) ) ) (progn (setq *bbox_RestoreLayerLockList* (cons oLayer *bbox_RestoreLayerLockList* ) ) (vla-put-lock oLayer :vlax-false) ) ) (vla-put-entitytransparency (car item) (cdr item)) ) (foreach layer restoreLayerLockList (vla-put-lock layer :vlax-true) ) (foreach x '(*bbox_EntityFadeReactor* bbox:EntityFadeCallback *bbox_RestoreFadeList* ) (set x nil) ) ) ) ) (setq *bbox_EntityFadeReactor* (vlr-command-reactor "bbox hide entity reactor" '((:vlr-commandwillstart . bbox:EntityFadeCallback)) ) ) (vlax-for x (setq ss (vla-get-activeselectionset (setq acDoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) ) (setq ignoreList (cons x ignoreList)) ) (vlax-for x (vlax-get acDoc (if (= 1 (getvar 'tilemode)) 'modelspace (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace ) ) ) (if (not (vl-position x ignoreList)) (progn (if (= :vlax-true (vla-get-lock (setq oLayer (vla-item (vla-get-layers acDoc) (vla-get-layer x) ) ) ) ) (progn (setq *bbox_RestoreLayerLockList* (cons oLayer *bbox_RestoreLayerLockList* ) ) (vla-put-lock oLayer :vlax-false) ) ) (setq *bbox_RestoreFadeList* (cons (cons x (vla-get-entitytransparency x) ) *bbox_RestoreFadeList* ) ) (vla-put-entitytransparency x fade) ) ) ) (foreach layer restoreLayerLockList (vla-put-lock layer :vlax-true) ) ) (if (not ss) (prompt "\n** LayLockFadeCtrl value must be 1-90 ** ") ) ) (princ) ) ** Note - I am unsure what version first implemented EntityTransparency Property, so some pre-2011 versions may not be able to use this. Edited May 3, 2013 by BlackBox Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 2, 2013 Share Posted May 2, 2013 Looking back at the old(-er) code I posted, it could really use some updating... Never mind the obvious error handling, but it should also account for nested entities, and I should look into the newer features available to account for already locked (faded) layers, possibly un-fading the selected entities, etc.. In any event, hopefully it's of some use to the thread. *shrug* Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 3, 2013 Share Posted May 3, 2013 Loosely related to my offering which manipulates EntityTransparency Property... Interesting ADNDevBlog article as well, for those who may be interested: Get and set layer and entity transparency using LISP Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted May 3, 2013 Share Posted May 3, 2013 (edited) Looks like I am very late to the party. Sorry!!! Was trying to mix VVA routine and AutoCAD "isolate objects" but, both (great) not working the same way. It was only reason to ask for extension of VVA program. Hope he will join soon and help me. Thank you all. What I notice is when closing and opening dwg (with VVA program) it stay in stage as it was closed: object not visible stay invisible versus AutoCAD "Isolate objects" when all is visible after reopen dwg. Edited May 3, 2013 by mdbdesign ADD COMMENT Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 3, 2013 Share Posted May 3, 2013 What I notice is when closing and opening dwg (with VVA program) it stay in stage as it was closed: object not visible stay invisible versus AutoCAD "Isolate objects" when all is visible after reopen dwg. That is why I included a reactor + callback in my offering, to restore the original status on Regen, Save*, Close, or Quit invocation... The same principle can be used in your situation (if IsolateObjects is somehow insufficient). Cheers Quote Link to comment Share on other sites More sharing options...
VVA Posted May 4, 2013 Share Posted May 4, 2013 Only one question: Is possible to extend it to another option as "Show selected only"Similar to AutoCAD's "Isolate Object". I know it is older post but will waiting for answer. Thank you again. ...It was only reason to ask for extension of VVA program. Hope he will join soon and help me. Edit #17 Try new version Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted May 4, 2013 Share Posted May 4, 2013 That it, no more request. Thanks Volodia. Quote Link to comment Share on other sites More sharing options...
vnanhvu Posted January 10, 2014 Share Posted January 10, 2014 (edited) Agreed. Thankfully autocad is nice enough to have a yellow/red lightbulb button at the bottom right. Since they are similar enough, I will post these quick hide and isolate commands. I use these randomly when I want one thing out of my way for a moment. (defun c:HH (/ ss i) ;; temporarily hide pesky objects (regen will bring them back) ;; Alan J. Thompson (if (setq ss (ssget)) (repeat (setq i (sslength ss)) (redraw (ssname ss (setq i (1- i))) 2)) ) (princ) ) (defun c:II (/ tab all ss i e) ;; temporarily isolate selected objects (regen will bring them back) ;; Alan J. Thompson (setq tab (if (eq (getvar 'CVPORT) 1) '(410 . "Model") (cons 410 (getvar 'CTAB)) ) all (ssget "_A" (list tab)) ) (if (setq ss (ssget (list tab))) (repeat (setq i (sslength all)) (redraw (setq e (ssname all (setq i (1- i)))) (if (ssmemb e ss) 1 2 ) ) ) ) (princ) ) Your code is very Good. But with Defun II not work in Viewport Layout. You can fix this problem... Thank you ! Edited January 13, 2014 by vnanhvu Quote Link to comment Share on other sites More sharing options...
jSON Posted December 13, 2021 Share Posted December 13, 2021 On 6/2/2011 at 1:41 PM, VVA said: a few more links HideShow - hide selected objects from AutoCAD drawing (VLX for AutoCAD) Easily hide and isolate objects in AutoCAD 2011 Freeze Object(s) Quick and dirty (defun c:invis (/ errCount wMode objSet showset actDoc *error*) ;; ==================================================================== ;; ;; ;; ;; INVIS.LSP - Makes objects temporarily invisible and ;; ;; visible return of all or some ;; ;; ;; ;; ==================================================================== ;; ;; ;; ;; Command(s) to call: INVIS ;; ;; ;; ;; ==================================================================== ;; ;; ;; ;; THIS PROGRAM AND PARTS OF IT MAY REPRODUCED BY ANY METHOD ON ANY ;; ;; MEDIUM FOR ANY REASON. YOU CAN USE OR MODIFY THIS PROGRAM OR ;; ;; PARTS OF IT ABSOLUTELY FREE. ;; ;; ;; ;; THIS PROGRAM PROVIDES 'AS IS' WITH ALL FAULTS AND SPECIFICALLY ;; ;; DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS ;; ;; FOR A PARTICULAR USE. ;; ;; ;; ;; ==================================================================== ;; ;; ;; ;; V1.1, 11th Apr 2005, Riga, Latvia ;; ;; © Aleksandr Smirnov (ASMI) ;; ;; For AutoCAD 2000 - 2008 (isn't tested in a next versions) ;; ;; ;; ;;http://www.cadtutor.net/forum/showthread.php?43876-AsmiTools ;; ;; ==================================================================== ;; ;; ;; ;; V1.2, 02 June 2011, Minsk, Belarus ;; ;; © Vladimir Azarko (VVA) ;; ;; For AutoCAD 2000 - 2011 (isn't tested in a next versions) ;; ;; Add mode "Show some object" ;; ;; V1.3, 04 may 2013, Minsk, Belarus ;; ;; © Vladimir Azarko (VVA) ;; ;; For AutoCAD 2000 - 2011 (isn't tested in a next versions) ;; ;; Add mode "Show selected Only" ;; ;; ;; ;;http://www.cadtutor.net/forum/showthread.php?59655 ;; ;; ==================================================================== ;; ;; ;; (vl-load-com) (defun put_Visible_Prop (Object Flag) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-visible (list Object Flag) ) ) (setq errCount (1+ errCount)) );_ end if (princ) );_ end of put_Visible_Prop (defun Set_to_List (SelSet) (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex SelSet)) ) ) );_ end of Set_to_List (defun errMsg () (if (/= 0 errCount) (princ (strcat ", " (itoa errCount) " were on locked layer." ) ) "." );_ end if );_ end of errMsg (setq actDoc (vla-get-ActiveDocument (vlax-get-Acad-object) ) errCount 0 );_ end setq (vla-StartUndoMark actDoc) (initget "Visible Invisible Show Only" 1) (setq wMode (getkword "\nMake objects [Visible all/Invisible/Show some invisible objects/show selected Only]: " ) ) (cond ((and (= wMode "Visible") (setq objSet (ssget "_X" '((60 . 1)))) );_ end and (setq objSet (Set_to_List objSet)) (mapcar '(lambda (x) (put_Visible_Prop x :vlax-true)) objSet ) (princ (strcat "\n<< " (itoa (- (length objSet) errCount)) " now visible" (errMsg) " >>" ) ) ) ;_ # condition ((and (= wMode "Show") (setq objSet (ssget "_X" '((60 . 1)))) );_ end and (setq objSet (Set_to_List objSet)) (mapcar '(lambda (x) (put_Visible_Prop x :vlax-true)) objSet ) (princ (strcat "\n<< " (itoa (- (length objSet) errCount)) " now visible" (errMsg) " >>" ) ) (princ "\nSelect objects to show") (if (setq showset (ssget "_:L")) (progn (setq showset (Set_to_List showset)) (foreach item showset (setq objSet (vl-remove item objSet)) ) (mapcar '(lambda (x) (put_Visible_Prop x :vlax-false)) objSet ) ) ) ) ;_ # condition ((= wMode "Only") (if (not (setq objSet (ssget "_I"))) (setq objSet (ssget)) ) ;_ end if (if (and objset (setq objSet (Set_to_List objSet))) (progn (setq showset (ssget "_X" (list (cons 410 (getvar 'Ctab)))) showset (Set_to_List showset) ) (foreach item objSet (setq showset (vl-remove item showset)) ) (mapcar '(lambda (x) (put_Visible_Prop x :vlax-false)) showset ) (princ (strcat "\n<< " (itoa (- (length showset) errCount)) " now invisible" (errMsg) " >>" ) ) ) ) ) ;_ # condition (t (if (not (setq objSet (ssget "_I"))) (setq objSet (ssget)) );_ end if (if objSet (progn (setq objSet (Set_to_List objSet)) (mapcar '(lambda (x) (put_Visible_Prop x :vlax-false)) objSet ) (princ (strcat "\n<< " (itoa (- (length objSet) errCount)) " now invisible" (errMsg) " >>" ) ) );_ end progn );_ end if ) );_ end cond (vla-EndUndoMark actDoc) (princ) );_ end of c:invis (mapcar 'princ (list "\n[info] http://www.cadtutor.net/forum/showthread.php?59655 [info]" "\nType INVIS to make objects invisible or visible." ) ) (princ) I've been using this lisp on a 2011 version. I've tried it a 2022 version, and it's not working. Can someone figure out how it will work on a latest Autocad version. Looking forward for your responses. Thank you in advance. Quote Link to comment Share on other sites More sharing options...
mhupp Posted December 13, 2021 Share Posted December 13, 2021 (edited) Can you give more info? Does it give an error? -edit- This is a new install I take it? Double check you have the full lisp installed/loaded. Edited December 14, 2021 by mhupp Quote Link to comment Share on other sites More sharing options...
Steven P Posted December 13, 2021 Share Posted December 13, 2021 It isn't something I have used but a quick check on my AutoCAD 2021 and it works OK, so like Mhupp says, will need a bit more info about why it isn't working. Is it the whole thing not working or just 1 part, is there an error message and what does it say, where does it stop working.... but "this is broken" doesn't really help a lot 1 Quote Link to comment Share on other sites More sharing options...
CADZealot Posted April 11, 2022 Share Posted April 11, 2022 On 5/2/2013 at 2:11 AM, alanjt said: Agreed. Thankfully autocad is nice enough to have a yellow/red lightbulb button at the bottom right. Since they are similar enough, I will post these quick hide and isolate commands. I use these randomly when I want one thing out of my way for a moment. (defun c:HH (/ ss i) ;; temporarily hide pesky objects (regen will bring them back) ;; Alan J. Thompson (if (setq ss (ssget)) (repeat (setq i (sslength ss)) (redraw (ssname ss (setq i (1- i))) 2)) ) (princ) ) (defun c:II (/ tab all ss i e) ;; temporarily isolate selected objects (regen will bring them back) ;; Alan J. Thompson (setq tab (if (eq (getvar 'CVPORT) 1) '(410 . "Model") (cons 410 (getvar 'CTAB)) ) all (ssget "_A" (list tab)) ) (if (setq ss (ssget (list tab))) (repeat (setq i (sslength all)) (redraw (setq e (ssname all (setq i (1- i)))) (if (ssmemb e ss) 1 2 ) ) ) ) (princ) ) Hello Everyone, I'm looking for the same script to work on my Huge size drawing file., but instead of select all i would like to isolate only Line and Polylines from Selected objects. Can someone help me on this. Quote Link to comment Share on other sites More sharing options...
Steven P Posted April 11, 2022 Share Posted April 11, 2022 In there there is a comment "ssget", line 1 of the code, which can be modified to select what you want. This is a good reference http://lee-mac.com/ssget.html . So might be you change that line to (if (setq ss (ssget '((0 . "*LINE")))) the * before 'LINE' being a wildcard to also include polylines. So see if you can work out routine 'II' modifications.... Ask if this doesn't make sense of course Quote Link to comment Share on other sites More sharing options...
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.