Jump to content

Double "Hide/isolate objects" is it possible?


marmo

Recommended Posts

Hello everyone,:shock:

 

let me know if you can hide two different sets of objects and display them at different times. Let me explain:

the command "hide1" hides the first set of objects, the command "hide2" hides the second set, the command "unhide1" shows only objects of the first set, the command "unhide2" shows only objects of the second set, the command "unhide1+2 " unhide all.

The lisp may also include controls "isolate" and "toggle".

Now i use this lisp:

 

(defun OFF (OL / OBJNUM SSOBJ OBJECT OBJLIST)
(setq OBJNUM 0)
(repeat (sslength OL)
(setq SSOBJ (entget (ssname OL OBJNUM))
OBJNUM (+ OBJNUM 1)
OBJECT (append SSOBJ (list (cons 60 1)))
)
(if (= (cdr (assoc 0 SSOBJ)) "VIEWPORT")
(princ "\nViewports cannot be turned off.")
(entmod OBJECT)
)
)
)

(defun ON (OL / OBJNUM SSOBJ OBJECT)
(setq OBJNUM 0)
(repeat (sslength OL)
(setq SSOBJ (entget (ssname OL OBJNUM))
OBJNUM (+ OBJNUM 1)
OBJECT (subst (cons 60 0) (assoc 60 SSOBJ) SSOBJ)
)
(entmod OBJECT)
)
)

(defun C:OFF (/ OBJLIST)
(if (setq OBJLIST (ssget))
(OFF OBJLIST)
(princ "\nNo objects selected to turn off.")
)
)

(defun C:ON (/ OBJLIST OBJON OBJLISTLEN)
(if (setq OBJLIST (ssget "x" (list (cons 60 1))))
(progn
(ON OBJLIST)
(progn
(princ "\nSelect objects to turn on, or for all on.")
(setq OBJON (ssget))
(OFF OBJLIST)
(if OBJON
(ON OBJON)
(ON OBJLIST)
)
)
)
(princ "\nNo objects found to turn on.")
)
)

(defun C:TOGGLE (/ OBJLISTOFF OBJLISTON)
(setq OBJLISTOFF (ssget "x" (list (cons 60 1)))
OBJLISTON (ssget "x" (list (cons 60 0)))
)
(if OBJLISTOFF
(ON OBJLISTOFF)
(princ "\nNo objects found to toggle on.")
)
(if OBJLISTON
(OFF OBJLISTON)
(princ "\nNo objects found to toggle off.")
)
)

(defun C:ISOLATE (/ OBJLISTISO)
(if (setq OBJLISTISO (ssget))
(progn
(OFF (ssget "x"))
(ON OBJLISTISO)
)
(princ "\nNo objects selected to isolate.")
)
)

 

 

Thanks so much!!!

Marco

 

Sorry for my english:oops:

Link to comment
Share on other sites

Hi

you can use function (entlast) and prompt for two selection sets, so after all you can control with them by the name of the variables.

(setq ss1 (ssget))
(setq ssNme1 (entlast))
(setq ss2 (ssget))
(setq ssNme2 (entlast))

 

Regards

 

Tharwat

Link to comment
Share on other sites

I wrote a program awhile back to isolate objects no matter what layer they where on.

You can create named groups and turn them on or off. So you could have multiple objects no matter what layer and create a group then have other groups and toggle them via a dialog box with a tree. Check it out on my website it might give you a few ideas

It’s called 3D/2D Object Control

If you want to download it is a VLX file the lisp is way too much to post

http://www.jmhsoftware.com/4_QD%20Isolate.htm

Link to comment
Share on other sites

Hello,:shock:

 

JohnM thank you, I've seen programs that you wrote, I seems to me very interesting.:):):)

Tharwat313 Thanks to you for the suggestion, but admitted to not knowing the language lisp and not knowing what to change what I posted.:oops:

I imagined a lisp easy and fast to use.

I set auatocad to have no icons, then I changed the PGP have access to commands that I use often, such as those relating to the display of layers, selection filters and isolation of objects.

I then imagined a lisp "double hide" very fast to use, then a few steps, a few menus etc.

For example, a command session could be::geek:

"H", "space bar", "select obj - hide first

"HH", "space bar" "SELECT OBJ - second hide

"UH", "space bar" - unhide first

"UHH", "space bar" - unhide second

without going through the menu or otherwise.

Thanks anyway for your attention.

Although I do not know the language lisp find this site really fantastic and interesting.:D

 

Marco

Link to comment
Share on other sites

Regarding to Hide command you can use LAYOFF and this will control with all of your issues, Beside that, you can

make the abbreviation to it through PGP file.

 

regards

 

Tharwat

Link to comment
Share on other sites

Hello,:shock:

 

I use customized aliases already to display layers.

Frequently i use LayON and LayFRZ with controls LayON and LayTHW.

They work separately and have the same effects to the display of objects.

Sometimes I need to keep switched on and thawed all the layers and hide large parts of the drawing for long time (heavy to regenerate),

and hide/show a little parts (easy to regenerate) during work.

For this I have thought it was possible to have a double hide/unhide.

I do not know the language lisp and I have no idea if it is difficult to write...:sweat:

 

Thanks,

Marco

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...