Color2Llayers

Short description

🎨 Color2Llayers is an AutoCAD AutoLISP Extended Layer Color Changer with a DCL list, wildcard filter, multi-select, pick color, apply, undo, clipboard export, and dialog position memory.
🧰 It edits layer color values directly and uses a reopen-after-Apply pattern so AutoCAD can regenerate and show color changes immediately.

Command:

πŸš€ Main color changer command: XCC – opens the Extended Layer Color Changer dialog
πŸš€ Lowercase alias: xcc – opens the same color changer dialog
πŸš€ Diagnostic command: XCCDEBUG – prints a debug report for DCL and environment troubleshooting
πŸš€ Test command: XCCTEST – prints a simple test confirmation

Description:

🎨 Color2Llayers is an SEO-friendly AutoCAD layer color changer and CAD standards utility.
πŸ” The XCC dialog shows layer rows with flags, layer names, color, and linetype information, plus a wildcard filter that supports * and ?.
🎯 Users can multi-select layers, choose Pick Color, click Apply, and immediately see changes after the dialog safely closes and reopens using done_dialog 2 and REGENALL.
↩️ The routine stores an undo snapshot before writing layer color changes and supports an Undo button inside the dialog.
πŸ“‹ A Copy to Clipboard button exports layer name, color, and linetype rows through a temporary tab-delimited file and Windows clip.exe when available.
πŸ’Ύ Dialog X/Y position and filter text are saved with getcfg/setcfg for the next session.

Helper function: (if any)​

🧩 xcc:all-layers builds the layer list from the drawing table.
🧩 xcc:build-list and xcc:build-disp prepare filtered layer rows for the DCL list box.
🧩 xcc:on-filter, xcc:on-hscroll, xcc:select-all, and xcc:select-none manage dialog interaction.
🧩 xcc:pick-color calls the AutoCAD color dialog and stores the selected color.
🧩 xcc:apply-snap and xcc:apply-write capture undo data and write new layer colors.
🧩 xcc:undo-last restores the previous color snapshot.
🧩 xcc:copy-clipboard writes selected rows to a temp file and pushes them to the clipboard.
🧩 xcc:dialog-loop implements the reopen-after-Apply pattern for safe REGENALL updates.

Functionalities:

βœ… Display all drawing layers with name, color, and linetype information.
βœ… Filter layer names using * and ? wildcard patterns.
βœ… Select multiple layers in a DCL list box.
βœ… Select all or clear all layer selections.
βœ… Pick a new AutoCAD color through a color selection dialog.
βœ… Apply layer color changes and regenerate the drawing immediately.
βœ… Undo the last applied color change snapshot.
βœ… Copy selected layer/color/linetype rows to the clipboard.
βœ… Save dialog position and filter text between sessions.
βœ… Provide XCCDEBUG for troubleshooting DCL loading, temp file writing, and AutoCAD environment data.

Result:

🎯 The result is faster layer color editing with visual feedback, undo support, and clipboard reporting.
πŸ“Š This improves CAD layer standardization, plotting setup, layer QA/QC, and drawing cleanup in AutoCAD and Civil 3D workflows.

Images, animations etc.

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="Color2Llayers">
 <src:RibbonToolTip.ExpandedContent>
 <StackPanel>
 <TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: xccdebug / xcctest / xcc / XCC</Bold>
<LineBreak/>
<Bold>Version: 1.1 Date: 20.06.2026 6:38:52PM</Bold>
<LineBreak/>
<Hyperlink>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/pick-object-change-layer-properties/td-p/1416072</Hyperlink>
<LineBreak/>		

<TextBlock TextWrapping="Wrap" Foreground="Black">
  <Run FontWeight="Bold">Function:</Run> xcc – Change the color of a selected layer using an interactive color dialog.
</TextBlock>

<TextBlock TextWrapping="Wrap" Foreground="Black">
  <Run FontWeight="Bold">Overview:</Run>
  <LineBreak/>
  This command allows the user to select an entity and change the color of its associated layer via the AutoCAD color picker.
  <LineBreak/>	
  Change Layers Color To Entity Color.
</TextBlock>

<TextBlock TextWrapping="Wrap" Foreground="Black">
  <Run FontWeight="Bold">Workflow:</Run>
  <LineBreak/>
  β€’ Prompts the user to <Run Foreground="Blue" FontWeight="Bold">select an entity</Run>.
  <LineBreak/>
  β€’ Extracts the <Run Foreground="Green" FontWeight="Bold">layer name</Run> from the selected entity.
  <LineBreak/>
  β€’ Retrieves the layer's definition using <Run Foreground="Purple">tblobjname</Run> and <Run Foreground="Purple">entget</Run>.
  <LineBreak/>
  β€’ Opens the <Run Foreground="DarkOrange" FontWeight="Bold">acad_colordlg</Run> color dialog to let the user choose a new color.
  <LineBreak/>
  β€’ If a color is chosen, updates the layer's color using <Run Foreground="Red">entmod</Run>.
  <LineBreak/>
  β€’ Repeats until the user presses Enter (cancels selection).
</TextBlock>

<TextBlock TextWrapping="Wrap" Foreground="Black">
  <Run FontWeight="Bold">Key Features:</Run>
  <LineBreak/>
  β€’ Interactive layer color change through UI dialog.
  <LineBreak/>
  β€’ Does not require manually finding the layer – works from entity selection.
  <LineBreak/>
  β€’ Color updates are made directly to the layer table record.
</TextBlock>

<TextBlock TextWrapping="Wrap" Foreground="Black">
  <Run FontWeight="Bold">Ideal For:</Run>
  <LineBreak/>
  β€’ Quick color adjustments to layers.
  <LineBreak/>
  β€’ Visual layer management via geometry selection.
</TextBlock>

<Bold><Run Foreground="DodgerBlue">Description</Run></Bold><LineBreak/><Run Foreground="White">🎨 Color2Llayers is an AutoCAD AutoLISP layer color management tool built around the XCC command.</Run><LineBreak/><Run Foreground="LimeGreen">🧰 It provides a production-oriented DCL interface for filtering layers, selecting multiple layers, picking a new color, applying changes, undoing recent changes, and copying layer/color/linetype data to the clipboard.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="DodgerBlue">Function Syntax</Run></Bold><LineBreak/><Run Foreground="White">Main color changer command: </Run><Bold><Run Foreground="Orange">XCC</Run></Bold><Run Foreground="White">opens the Extended Layer Color Changer dialog</Run><LineBreak/><Run Foreground="White">Lowercase alias: </Run><Bold><Run Foreground="Orange">xcc</Run></Bold><Run Foreground="White">opens the same color changer dialog</Run><LineBreak/><Run Foreground="White">Diagnostic command: </Run><Bold><Run Foreground="Orange">XCCDEBUG</Run></Bold><Run Foreground="White">prints a debug report for DCL and environment troubleshooting</Run><LineBreak/><Run Foreground="White">Test command: </Run><Bold><Run Foreground="Orange">XCCTEST</Run></Bold><Run Foreground="White">prints a simple test confirmation</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="DodgerBlue">SEO Optimized Overview</Run></Bold><LineBreak/><Run Foreground="White">🎨 Color2Llayers is an SEO-friendly AutoCAD layer color changer and CAD standards utility.</Run><LineBreak/><Run Foreground="White">πŸ” The XCC dialog shows layer rows with flags, layer names, color, and linetype information, plus a wildcard filter that supports * and ?.</Run><LineBreak/><Run Foreground="White">🎯 Users can multi-select layers, choose Pick Color, click Apply, and immediately see changes after the dialog safely closes and reopens using done_dialog 2 and REGENALL.</Run><LineBreak/><Run Foreground="White">↩️ The routine stores an undo snapshot before writing layer color changes and supports an Undo button inside the dialog.</Run><LineBreak/><Run Foreground="White">πŸ“‹ A Copy to Clipboard button exports layer name, color, and linetype rows through a temporary tab-delimited file and Windows clip.exe when available.</Run><LineBreak/><Run Foreground="White">πŸ’Ύ Dialog X/Y position and filter text are saved with getcfg/setcfg for the next session.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="LimeGreen">Primary Workflow</Run></Bold><LineBreak/><Run Foreground="White">1️⃣ Run </Run><Bold><Run Foreground="Orange">XCC</Run></Bold><Run Foreground="White"> at the AutoCAD command line.</Run><LineBreak/><Run Foreground="White">2️⃣ Type a wildcard filter to narrow the layer list, or keep * to show all layers.</Run><LineBreak/><Run Foreground="White">3️⃣ Select one or more layers, then click Pick Color to choose the target color.</Run><LineBreak/><Run Foreground="White">4️⃣ Click Apply to write the color changes and reopen/regenerate the dialog.</Run><LineBreak/><Run Foreground="White">5️⃣ Use Undo if the last color change should be reverted, or Copy to Clipboard to export layer rows.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="LimeGreen">Functionalities</Run></Bold><LineBreak/><Run Foreground="White">βœ… Display all drawing layers with name, color, and linetype information.</Run><LineBreak/><Run Foreground="White">βœ… Filter layer names using * and ? wildcard patterns.</Run><LineBreak/><Run Foreground="White">βœ… Select multiple layers in a DCL list box.</Run><LineBreak/><Run Foreground="White">βœ… Select all or clear all layer selections.</Run><LineBreak/><Run Foreground="White">βœ… Pick a new AutoCAD color through a color selection dialog.</Run><LineBreak/><Run Foreground="White">βœ… Apply layer color changes and regenerate the drawing immediately.</Run><LineBreak/><Run Foreground="White">βœ… Undo the last applied color change snapshot.</Run><LineBreak/><Run Foreground="White">βœ… Copy selected layer/color/linetype rows to the clipboard.</Run><LineBreak/><Run Foreground="White">βœ… Save dialog position and filter text between sessions.</Run><LineBreak/><Run Foreground="White">βœ… Provide XCCDEBUG for troubleshooting DCL loading, temp file writing, and AutoCAD environment data.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="DodgerBlue">Important Commands and Functions</Run></Bold><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">XCC</Run></Bold><Run Foreground="White"> - main command for the Extended Layer Color Changer.</Run><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">XCCDEBUG</Run></Bold><Run Foreground="White"> - diagnostic command that prints DCL and environment details.</Run><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">acad_colordlg</Run></Bold><Run Foreground="White"> - AutoCAD color picker used by the tool.</Run><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">entmod</Run></Bold><Run Foreground="White"> - writes color changes to layer table records.</Run><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">done_dialog 2</Run></Bold><Run Foreground="White"> - closes the modal DCL temporarily so REGENALL can run safely.</Run><LineBreak/><Run Foreground="White">🧩 </Run><Bold><Run Foreground="Orange">clip.exe</Run></Bold><Run Foreground="White"> - Windows clipboard helper used for tab-delimited layer export.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="LimeGreen">Result</Run></Bold><LineBreak/><Run Foreground="White">🎯 The result is faster layer color editing with visual feedback, undo support, and clipboard reporting.</Run><LineBreak/><Run Foreground="White">πŸ“Š This improves CAD layer standardization, plotting setup, layer QA/QC, and drawing cleanup in AutoCAD and Civil 3D workflows.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="DarkRed">Important Notes</Run></Bold><LineBreak/><Run Foreground="White">⚠️ The tool changes layer color properties, which affects all objects displayed BYLAYER on those layers.</Run><LineBreak/><Run Foreground="White">⚠️ Use filters and multi-select carefully before applying changes in large project drawings.</Run><LineBreak/><Run Foreground="White">⚠️ Clipboard export depends on Windows clip.exe; without it, the routine saves the temporary export file path instead.</Run><LineBreak/><LineBreak/>
<Bold><Run Foreground="Yellow">Tags</Run></Bold><LineBreak/><Run Foreground="Yellow">🏷️ AutoCAD, 🏷️ AutoLISP, 🏷️ Civil 3D, 🏷️ Layer Color, 🏷️ Color2Llayers, 🏷️ XCC, 🏷️ Layer Standards, 🏷️ DCL Dialog, 🏷️ Clipboard Export, 🏷️ CAD Cleanup</Run><LineBreak/>

 
</TextBlock>
 
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->
<Grid>
<Image Source="Color2Llayers.png" Stretch="Uniform"/>
</Grid>
 
 </StackPanel>
 </src:RibbonToolTip.ExpandedContent>
 </src:RibbonToolTip>
</ResourceDictionary>

Share this page:

Leave a Reply

Page Tag: 🏷️ XCC

  • Color2Llayers

    β€”

    by

    Short description🎨 Color2Llayers is an AutoCAD AutoLISP Extended Layer Color Changer with a DCL list, wildcard filter, multi-select, pick color, apply, undo, clipboard export, and dialog position memory. 🧰 It edits layer color values directly and uses a reopen-after-Apply pattern so AutoCAD can regenerate and show color changes immediately. Command:πŸš€ Main color changer command: XCC…