NEW.lsp — New Project Creation Workflow

Module: new.lsp
Version: v3.60
Category: Project Management
Complexity: Medium
Size: 1.9 KB (38 lines)

Note

Project Directory Setup

This module handles the creation of new projects by prompting for project name and directory, validating input, creating the directory structure, and initializing project state variables.


Overview

Purpose

The new function guides users through new project creation by collecting project name/directory, validating input against AutoCAD naming rules, creating the directory structure via Windows shell command, and setting up initial project state.

Algorithm

  1. Initialize & Loop Until Valid Input

    • Set default directory to acaddir/Project Files/

    • Display “new” dialog from new.dcl

  2. Dialog Configuration

    • pjname field: Character validation via chrchk

    • curdir field: Character validation via chrchk

    • Help context: “nw”

  3. Input Validation

    • Ensure not empty

    • Ensure not default “Project Files\” directory

    • Ensure not acaddir (AutoCAD installation)

  4. Directory Creation

    (command "shell" "cv" "path" "to" "dir" "end")
    
    • Uses Windows shell to create directory structure

    • Creates nested directories if needed

  5. Initialize Project State

    • newpan = “new”

    • x = “t” (success flag)

    • ld = “pt” (panel template mode)

    • xx = “new”


Key Features

Directory Path Building

Shell Command Format:

"cv" "path" "element1" "element2" "..." "end"

Example:

Input: C:\My Projects\Building\
Output: "cv" "C:" "My" "Projects" "Building" "end"

Validation Loop

Continues Until:

  • Valid directory entered

  • User cancels (pnl = “cancel”)


Global Variables

Input:

  • acaddir - AutoCAD installation directory

  • curdir - Current/selected directory

  • pnl - User action (“cancel” or continue)

Output:

  • curdir - New project directory (with trailing backslash)

  • newpan - Set to “new”

  • ld - Load mode (“pt”)

  • xx - Status (“new”)

  • x - Success flag



Document Metadata

Status: Comprehensive analysis
Last Updated: 2026-01-20


End of Document