Toggle 2d/3d On/Off

Occasionally I incorporate an option to turn off the 2d or 3d script of an object. This is useful if I want an element to be used for a plan symbol, but not show up in 3d. As an example, I may want a ceiling fixture to be used as a plan symbol, but not be included in the elevations/sections/model views. Or I may have a piece of furniture that I want to use as part of a furniture plan, but do not want to use the object as part of the model environment. Obviously there are ways to do this with layers, but it is just as easy to incorporate a parameter and line of script into the object for added control; which also eliminates someone “accidentally” including unintended objects into presentation documents.

Step 1: Add a new parameter to the list of available parameters. This variable will be called ThreeD_Script_Control, it will be Boolean, set the name to 3D View, set the default Value to On (or 1).

FIG. 5.1 New Boolean Parameter Variable

Step 2: Add two lines of script to the the top of the 3d script tab. They should read as:

IF ThreeD_Script_Control = 0 THEN END ELSE


This statement is using the 0-1 relationship of the boolean parameter, where 1 = on and 0 = off. By stating that IF “Variable” = 0, you are giving a command for when it is off. THEN END, is telling the script to ignore any script or commands that follows. ELSE (enter) ENDIF allows the IF/THEN to be ignored for all other conditions, or when the parameter is on (1).

FIG. 5.2 Variable Control in 3d Script for On/Off Parameter