AnnoAllOnOff

Short description

  • Single dialog that sets ANNOALLVISIBLE to 1 or 0 for a chosen set of Model/Layout tabs.
  • Combines the functionality of AAON and AAOFF with mode radio buttons and tab multi-select in one UI.
annoallonoff 000

Command:

  • Command: AAVIS

Description:

  • Generates an embedded DCL dialog at runtime that provides a Mode selector and a multi-select list of Model / Layout tabs.
  • Mode is chosen via radio buttons: Visible (AAON) sets ANNOALLVISIBLE to 1, and Hidden (AAOFF) sets it to 0.
  • Tabs are selected via list box with helper buttons All and None, then applied on OK.
  • Note: ANNOALLVISIBLE is stored per Model/Layout tab, so the change is applied by switching tabs rather than modifying viewport entities.

Helper function: (if any)​

  • AAVIS:WriteDcl writes the embedded DCL definition to a temporary .dcl file for the session.
  • AAVIS:GetTabNames enumerates the document layouts via ActiveX and returns a list of tab names including Model.
  • AAVIS:MakeAllIndexString generates the list box index string needed to select all tabs by default and via the All button.
  • AAVIS:IdxList->Names converts the list box selection index string into a list of tab names to update.
  • AAVIS:SetAnnoAllVisible switches to each selected tab, forces paperspace for layouts when needed, runs ANNOALLVISIBLE with the selected value, then restores prior state.
  • c:AAVIS drives the UI: sets defaults, handles All/None buttons, reads the chosen mode and tabs on OK, applies the update, and cleans up temp files.

Functionalities:

  • Embedded DCL is written to a temp file at runtime and loaded to display a single configuration dialog.
  • Mode selection via radio buttons: Visible (AAON) sets value 1, Hidden (AAOFF) sets value 0.
  • Multi-select tab picker allows choosing any combination of Model/Layout tabs to update.
  • All selects all tabs using a generated index string, and None clears selection to prevent changes.
  • Per-tab application switches CTAB for each selected tab and applies ANNOALLVISIBLE to the chosen value.
  • Layout handling forces paperspace on layout tabs by setting MSPACE to false when in a layout context.
  • State restoration restores CTAB, TILEMODE, and MSPACE after execution.

Result:

  • If the user confirms a selection, sets ANNOALLVISIBLE to the chosen value (1 or 0) for each selected tab and restores the prior tab/mode state.
  • If no tabs are selected, prints AAVIS: Nothing selected. No changes made.
  • If the dialog is cancelled, prints AAVIS: Cancelled.
  • If the dialog cannot be loaded, prints AAVIS: Could not load dialog.
  • After applying, prints a confirmation message indicating the value applied to the selected tabs.

Images, animations etc.

annoallonoff 000
Pixel

XAML code:

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
    
<src:RibbonToolTip x:Key="AnnoAllOnOff">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="AnnoAllOnOff">
<Bold>Function Syntax: Command</Bold>
<LineBreak/>
<Bold>Version: 1 Date: 23.12.2025</Bold>
<LineBreak/>
<LineBreak/>
<Hyperlink>AI+https://forums.autodesk.com/t5/autocad-forum/annotative-objects-not-displaying-in-layout-viewports/td-p/7949416</Hyperlink>
<LineBreak/>
<Bold><Span Foreground="DarkRed">AAVIS</Span> Description</Bold><LineBreak/>
This AutoLISP program provides a single command that lets the user set the AutoCAD system setting <Span Foreground="DarkRed">ANNOALLVISIBLE</Span> to either <Span Foreground="DarkRed">Visible</Span> (value <Span Foreground="DarkRed">1</Span>) or <Span Foreground="DarkRed">Hidden</Span> (value <Span Foreground="DarkRed">0</Span>) for a user-chosen set of drawing tabs (Model and Layouts).<LineBreak/>
It uses a dialog box (DCL) that is generated and loaded automatically from inside the LSP at runtime, so no separate DCL file is required to be installed or maintained by the user.<LineBreak/>

<Bold><Span Foreground="DarkRed">User Interaction</Span></Bold><LineBreak/>
• Run the command <Span Foreground="DarkRed">AAVIS</Span> in the AutoCAD command line.<LineBreak/>
• A dialog opens with two radio buttons:<LineBreak/>
• <Span Foreground="DarkRed">Visible (AAON)</Span> sets <Span Foreground="DarkRed">ANNOALLVISIBLE = 1</Span>.<LineBreak/>
• <Span Foreground="DarkRed">Hidden (AAOFF)</Span> sets <Span Foreground="DarkRed">ANNOALLVISIBLE = 0</Span>.<LineBreak/>
• In the same dialog, the user selects which tabs to update from a multi-select list containing <Span Foreground="DarkRed">Model</Span> and all <Span Foreground="DarkRed">Layout</Span> tabs.<LineBreak/>
• The user can use helper buttons:<LineBreak/>
• <Span Foreground="DarkRed">All</Span> selects all tabs in the list.<LineBreak/>
• <Span Foreground="DarkRed">None</Span> clears the selection in the list.<LineBreak/>
• Clicking <Span Foreground="DarkRed">OK</Span> applies the change to the selected tabs.<LineBreak/>
• Clicking <Span Foreground="DarkRed">Cancel</Span> exits without making changes.<LineBreak/>

<Bold><Span Foreground="DarkRed">Functionalities</Span></Bold><LineBreak/>
• Sets the AutoCAD variable <Span Foreground="DarkRed">ANNOALLVISIBLE</Span> to the chosen mode value (<Span Foreground="DarkRed">1</Span> or <Span Foreground="DarkRed">0</Span>) for the selected tabs.<LineBreak/>
• Supports three tab selection workflows:<LineBreak/>
• <Span Foreground="DarkRed">All</Span> tabs selected (fast global update).<LineBreak/>
• <Span Foreground="DarkRed">None</Span> selected (no action is performed).<LineBreak/>
• A user-defined subset (only the chosen tabs are modified).<LineBreak/>
• Automatically switches to each selected tab using <Span Foreground="DarkRed">CTAB</Span> and applies the setting.<LineBreak/>
• When a Layout tab is active, forces Paperspace by setting <Span Foreground="DarkRed">MSPACE</Span> to false before running the command, ensuring consistent behavior in layouts.<LineBreak/>
• Restores the user environment after completion by resetting:<LineBreak/>
• The previously active tab (<Span Foreground="DarkRed">CTAB</Span>).<LineBreak/>
• The previous Model or Layout mode (<Span Foreground="DarkRed">TILEMODE</Span>).<LineBreak/>
• The prior viewport mode in layouts (<Span Foreground="DarkRed">MSPACE</Span>) when applicable.<LineBreak/>

<Bold><Span Foreground="DarkRed">Important Behavior Notes</Span></Bold><LineBreak/>
• The selection list represents <Span Foreground="DarkRed">tabs</Span> (Model and Layouts), not individual viewport objects inside a layout.<LineBreak/>
• The program changes the annotation visibility setting at the tab level by issuing the AutoCAD command <Span Foreground="DarkRed">ANNOALLVISIBLE</Span> with the appropriate value.<LineBreak/>
• If the user selects no tabs and clicks OK, the program prints a message indicating no changes were made.<LineBreak/>

<Bold><Span Foreground="DarkRed">Files and Dependencies</Span></Bold><LineBreak/>
• Uses <Span Foreground="DarkRed">VLAX</Span> and therefore calls <Span Foreground="DarkRed">(vl-load-com)</Span>.<LineBreak/>
• Generates a temporary DCL file (for the dialog definition) at runtime and deletes it after the dialog closes, so no permanent DCL file remains on disk.<LineBreak/>
• Does not require the user to select blocks, objects, or viewports in the drawing area; all interaction is via the dialog list selection.<LineBreak/>

</TextBlock>
            
<Grid>
<Image Source="PNG" Stretch="Uniform"/>
</Grid>

<Grid>
<MediaElement
 Source="GIF"
 Stretch="Uniform"
 Visibility="Visible"/>
 </Grid>

</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>



Additional info:

Share this page:

Tags: 🏷️ Autocad Lisps, 🏷️ Layouts, 🏷️ Layouts_menu, 🏷️ Model Space, 🏷️ Paper Space