Product: MDT 4.x

Q: Visibility Macros (5012)

A: The first macro AMMHIDE is one to allow selection of Parts using Crossing etc for turning off Visibility of selected PARTS/SUBS only when in Model Mode. The second is AMMUNHIDE, again to allow unhiding of PARTS/SUBS only in Model Mode. It should be noted that when you select the parts in AMMUNHIDE, you will not see them highited when you select them.

These routines will work on local and external parts.

They won't run in scene mode. I have no error checking as usual and use at own risk etc etc.:)

Download as zip ammhide.zip Download as lsp ammhide.lsp View as text ammhide.txt

(aj Note: Uses AMMODELINFO which is accepted at command line in mdt4 but does is not in Help's Command or System Variable and only listing in Google is this mdtfaq5012.)

To load, cut and paste to notepad and save as AMMHIDE.LSP to a location within your search path.
At the command line type:-

Command: (Load "AMMHIDE")

to Run it, type

Command: AMMHIDE
or
Command: AMMUNHIDE

In addition Mark Stapel has shared his visibility button macros with us. These buttons take into consideration the mode you are in for Scene or Model. This avoids confusion with MDT Visibility buttons which are mode specific.

I hope this will help, here are some of the routines I use very often (the work on both local and external Parts):

;Unhide picked object (visualize thawed select)
(defun c:VTS() (if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_UNHIDEPICK)(IF (=
(ammodelinfo "S") 1)(C:TB_SCVIS_UNHidepick)(C:TB_ASSMVIS_UNHIDEPICK))))

;Hide all Except (visualize except)
(defun c:VE() (if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_HIDEALLEX)(IF (=
(ammodelinfo "S") 1)(C:TB_SCVIS_HideALLEX)(C:TB_ASSMVIS_HIDEALLEX))))

;Hide picked object (visualize freeze)
;(defun c:VF() (if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_HIDEPICK)(IF (=
(ammodelinfo "S") 1)(C:TB_SCVIS_Hidepick)(C:TB_ASSMVIS_HIDEPICK))))

;Unhide all objects (visualize thaw)
(defun c:VT() (if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_UNHIDEALL)(IF (=
(ammodelinfo "S") 1)(C:TB_SCVIS_DISPPARTS)(C:TB_ASSMVIS_DISPPARTS))))

;With Drew's Function (thanks Drew) replacing VF (assuming Ammhide is
already loaded)
(defun c:VF() (if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_HIDEPICK)(IF (=
(ammodelinfo "S") 1)(C:TB_SCVIS_Hidepick)(C:AMMHIDE))))

I also put the inserted a portion of the above routine into a button and it
worked for Model, Scene and Drawing Mode.

Example I added (for Hide Picked objects-VF) button:
(if (= (ammodelinfo "D") 1)(C:TB_DWGVIS_HIDEPICK)(IF (= (ammodelinfo "S")
1)(C:TB_SCVIS_Hidepick)(C:TB_ASSMVIS_HIDEPICK)))

I hope it helps,

Mark Stapel