CubeDisplay_Off_On

Short description

This AutoLISP routine toggles the AutoCAD Navigation Cube (ViewCube) display by sending direct commands through the Active Document COM interface. It ensures that the cube display setting is refreshed properly by first turning it off and then immediately turning it back on.
icon navvcubedisplayoffon

Command:

Command: c:NavvCubeDisplayOffOn When executed, this command uses ActiveX and vla-sendcommand to issue system commands that control the ViewCube visibility state.

Description:

When executed, the program performs the following actions: • Loads the COM interface using (vl-load-com) to access the AutoCAD ActiveX API. • Retrieves the active drawing document object using (vla-get-activedocument (vlax-get-acad-object)). • Sends the AutoCAD command NAVVCUBEDISPLAY 1 to temporarily disable the Navigation Cube. • Immediately sends NAVVCUBEDISPLAY 3 to re-enable and refresh the cube display, ensuring it becomes visible and properly updated. • Finishes silently using (princ) to avoid leaving residual command line messages.

Helper function: (if any)​

Helper Functions and Commands Used:(vl-load-com) — enables the Visual LISP COM interface for ActiveX communication.(vla-get-activedocument (vlax-get-acad-object)) — retrieves the active drawing object.(vla-sendcommand acadDoc “_.NAVVCUBEDISPLAY 1 “) — disables the ViewCube display.(vla-sendcommand acadDoc “_.NAVVCUBEDISPLAY 3 “) — re-enables and refreshes the cube display.

Functionalities:

Main Functionalities:Turns off and re-enables the Navigation Cube display automatically. • Uses vla-sendcommand instead of manual user input, allowing programmatic control from scripts or macros. • Provides a quick way to refresh the ViewCube when it becomes unresponsive or missing. • Compatible with AutoCAD 2010+ versions supporting NAVVCUBEDISPLAY command.

Result:

Result: After running the command, the Navigation Cube will reappear on screen, fully refreshed and responsive. This is especially helpful when the cube becomes invisible after workspace changes, viewport switching, or 3D navigation glitches.

Images, animations etc.

Pixel

Additional info:

Share this page:

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Tags: Coordinates
0
Would love your thoughts, please comment.x
()
x