Function Syntax: CreateBlockSelect / CreateBlockSelect1 Version: 1.0 Date: 09.04.2026 Version: 1.1 Date: 20.06.2026 6:38:48PM N/A SEO Title: AutoCAD AutoLISP Block Creation Tool with Smart Selection, Naming, Layers, MText Labels, and Block Rename Tools ?? Meta Description: CreateBlockSelect.lsp is an AutoCAD AutoLISP utility that helps users convert selected drawing entities into named blocks with automatic numbering, custom insertion points, layer control, optional MText labels, and block rename tools. SEO Keywords: AutoCAD AutoLISP block creator, Civil 3D block automation, AutoCAD selection to block, AutoLISP DCL dialog, automatic block naming, AutoCAD MText label, block rename AutoLISP, CAD productivity tool Suggested URL Slug: autocad-autolisp-create-block-select-tool ?? Plugin Type: AutoCAD AutoLISP utility with a generated DCL settings dialog. Important Note: This uploaded file is an AutoLISP LSP script, not a C# plugin project. ?? Main Purpose: This program helps AutoCAD and Civil 3D users quickly convert selected drawing geometry into reusable named blocks through an interactive settings dialog. It is designed to save time when creating many blocks that need consistent names, numbering, layers, insertion points, optional labels, and optional attributes. ?? Main Commands: • CreateBlockSelect creates one single block from all selected entities. • CreateBlockSelect1 creates one separate block for each selected entity. ?? User Workflow: • The user runs CreateBlockSelect or CreateBlockSelect1 from the AutoCAD command line. • The program opens a custom CreateBlockSelect - Settings dialog. • The user configures the block name prefix, numbering style, insertion point, scale, rotation, target layer, MText label options, and original-object behavior. • The user clicks Create. • The program asks the user to select drawing entities in AutoCAD. • The selected geometry is copied into a new block definition. • A block reference is inserted back into the drawing at the calculated or manually picked insertion point. • The dialog reopens after creation so the user can continue creating more blocks without restarting the command. • The user clicks Close to exit the tool. ? Key Functionalities: • ?? Selection to Block: Converts selected AutoCAD entities into named block definitions. • ?? Batch Block Creation: Supports creating one block from the full selection or separate blocks from each selected entity. • ??? Automatic Block Naming: Generates block names using a prefix, start number, increment value, padding, and suffix style. • ?? Multiple Numbering Formats: Supports zero-padded numbers, decimal values, hexadecimal suffixes, and alphabetic suffixes. • ??? Live Name Preview: Shows the number of matching existing blocks, the next available block name, and the following available name. • ?? Smart Insertion Point: Lets the user choose from nine bounding-box positions such as top-left, middle-center, bottom-left, and bottom-right. • ??? Manual Pick Point: Allows the user to click a custom insertion point directly in the drawing. • ?? Scale and Rotation Control: Applies custom X, Y, Z scale values and rotation when inserting the new block reference. • ?? Layer Assignment: Places the inserted block reference on a selected drawing layer. • ?? Layer Filtering: Provides wildcard filtering for the layer list using patterns such as * and ?. • ?? Block List Browser: Displays existing blocks in the drawing and supports wildcard filtering. • ?? Block Rename Tool: Lets the user select an existing block from the list and rename it directly from the dialog. • ?? Optional MText Label: Can place the generated block name as an MText label in the drawing. • ?? Independent MText Position: The MText label has its own nine-position insertion setting separate from the block insertion point. • ?? MText Height Control: Allows the user to define the text height for the block-name label. • ??? MText Layer Control: Allows the label to be placed on a dedicated layer. • ??? Optional TAG Attribute: Can add a TAG attribute definition to the block and synchronize the inserted attribute value with the block name. • ?? Keep or Erase Originals: The user can keep the original selected geometry or erase it after block creation. • ?? Persistent Settings: Saves user settings to a temporary configuration file so the dialog remembers previous values. • ?? Dialog Position Memory: Stores the last dialog screen position and restores it across AutoCAD sessions. • ??? Undo Support: Wraps block creation operations with AutoCAD undo marks for safer editing. • ?? Diagnostic Output: Prints debug information to the AutoCAD command line to help identify errors during block creation. ?? What CreateBlockSelect Does: The CreateBlockSelect command requires the user to select one or more drawing objects. All selected objects are grouped into one new block definition. The block is inserted back into the drawing at the selected insertion point. This command is best for converting a complete selected group of geometry into one reusable block. ?? What CreateBlockSelect1 Does: The CreateBlockSelect1 command requires the user to select multiple entities. Each selected entity is processed independently. Each entity becomes its own separate block with its own automatically generated name. This command is useful when many individual objects need to become separate reusable blocks quickly. ??? Block Naming System: • The user defines a name prefix such as BLOCK_. • The user defines the starting number. • The user defines the increment value. • The user defines the number of padded digits. • The program scans the existing block table to avoid duplicate block names. • The program automatically skips existing names and finds the next available valid block name. ?? Supported Suffix Styles: • Zero-padded: Creates names such as BLOCK_001, BLOCK_002, and BLOCK_003. • Decimal: Creates numeric decimal-style suffixes. • Hexadecimal: Creates names using hexadecimal numbering. • Alphabetic: Creates alphabet-based suffixes such as A, B, C, and extended alphabetic values. ?? Insertion Point Options: • Top-Left • Top-Center • Top-Right • Middle-Left • Middle-Center • Middle-Right • Bottom-Left • Bottom-Center • Bottom-Right ?? Default Insertion Point: Bottom-Left is used by default when no custom point is selected. ?? Geometry Handling: • The code calculates the bounding box of the selected objects. • The bounding box is used to determine the selected insertion point location. • If the user chooses Pick Point, the manually clicked point overrides the automatic bounding-box point. • The selected entities are copied into the new block definition. • The new block reference is inserted into the same drawing space as the original objects. ?? MText Label Feature: • The user can enable Place block name as MText. • When enabled, the program creates an MText object containing the generated block name. • The MText insertion point can be different from the block insertion point. • The MText height can be customized. • The MText can be assigned to a specific layer. • The MText width is calculated based on the text height and the length of the block name. ??? TAG Attribute Feature: • When Add TAG attribute is enabled, the program adds an attribute definition to the block. • The attribute tag is named TAG. • The attribute prompt is Block Name. • The inserted block reference receives the generated block name as the attribute value. • This makes the block easier to identify, schedule, tag, or extract later. ??? Layer Management: • The program reads all layers from the drawing. • The user can filter layers using wildcard patterns. • The selected layer is applied to the inserted block reference. • The MText label can use its own separate layer setting. ?? Existing Block Management: • The dialog displays a list of existing blocks in the drawing. • Anonymous system blocks are skipped from the block list. • The user can filter the block list with wildcard patterns. • The user can select an existing block, enter a new name, and click Rename. • The code checks whether the new block name already exists before renaming. ?? Saved Settings: • The program writes settings to CreateBlockSelect_v4.cfg in the AutoCAD temporary folder. • Saved values include prefix, increment, padding, insertion point, suffix style, start number, scale, rotation, layer, keep-originals option, TAG option, MText options, and dialog position. • The next time the command runs, the dialog reloads these values automatically. ?? Dialog Behavior: • The dialog is generated dynamically as a temporary DCL file. • The dialog contains block naming controls, preview controls, block list controls, insertion point controls, MText controls, layer controls, and action buttons. • Clicking Create closes the dialog, performs the block creation, then reopens the dialog for another operation. • Clicking Pick Point temporarily closes the dialog, lets the user choose a point in the drawing, then reopens the dialog. • Clicking Close exits the command. ??? Safety and Error Handling: • The program uses AutoCAD undo marks around the creation process. • The program catches cancel, break, and exit events without displaying unnecessary error messages. • The debug helper prints key variables and operation status to the command line. • Some COM operations are wrapped with error handling to reduce crashes during attribute and MText creation. ?? Technical Note: The preview refresh function appears to contain a malformed expression when calculating the “One after” name. The suspicious part is *CreateBlockSelect-bp*val2*CreateBlockSelect-inc*, which looks like several variables were accidentally joined into one symbol. The intended logic appears to be calculating the next available name after the current next name. This may affect the preview display and should be reviewed before production use. ?? Best Use Cases: • Creating many numbered AutoCAD blocks from selected geometry. • Converting repeated CAD objects into reusable block definitions. • Preparing Civil 3D or AutoCAD drawings for cleaner object organization. • Creating named blocks with consistent labels and attributes. • Quickly renaming existing block definitions from a dialog interface. • Building CAD libraries with predictable naming standards. ?? Main Benefits: • Saves drafting time by automating repetitive block creation. • Reduces naming mistakes by automatically finding available block names. • Improves drawing organization with layer control and naming rules. • Makes blocks easier to identify with optional MText labels and TAG attributes. • Speeds up batch workflows by reopening the dialog after each creation. • Helps maintain CAD standards through consistent prefixes, numbering, scale, rotation, and layer settings. ?? Website Summary: CreateBlockSelect.lsp is a productivity-focused AutoCAD AutoLISP tool that converts selected drawing entities into clean, named, reusable blocks. It includes automatic block naming, duplicate-name avoidance, layer selection, insertion-point control, optional MText labels, optional TAG attributes, block renaming, wildcard filtering, persistent settings, and dialog position memory. The tool is especially useful for CAD users who need to create many organized blocks quickly while maintaining consistent naming and drafting standards.