PROJECT.lsp — Project Selection & Initialization

Module: project.lsp
Version: v3.60
Category: Project Management
Complexity: Medium
Size: 2.7 KB (56 lines)

Note

Project Workflow Controller

This module manages the initial project selection workflow, determining whether the user wants to create a new project or open an existing one. It coordinates with new.lsp for new projects and handles directory validation for existing projects.


Overview

Purpose

The project function displays the project selection dialog and routes the user to the appropriate workflow (new project creation or existing project opening). It validates directory selections and prevents users from placing project files in AutoCAD system directories.

Role in CSV 3.60 Architecture

Position in Call Chain:

CSV command ? CSV.lsp ? (project) ? THIS MODULE ? new.lsp or dwgnew.lsp

Function Documentation

(project)

Algorithm:

  1. Display Project Dialog

    • Shows project.dcl with “New” or “Old” project options

    • Sets help context to “pj”

  2. Route Based on Selection:

    • pnl = “old”: Open existing project (validate directory)

    • pnl = “new”: Call (new) for new project creation

    • pnl = “cancel”: Set to “md” (menu display)

  3. Existing Project Validation:

    • Prompt for project directory using file dialog

    • Extract directory path from selected file

    • Call (dirchk) to validate directory

    • Alert if AutoCAD system directory detected

    • Loop until valid directory selected

  4. Post-Selection:

    • Load new.dcl “type” dialog for drawing type selection


Key Features

Directory Validation

Protection Logic:

(dirchk)
(if x
  (alert (strcat curdir "\nis an AutoCAD program directory...")))

Prevents:

  • Placing project files in AutoCAD installation directory

  • Placing project files in system directories

  • Accidental corruption of AutoCAD files

File Dialog Integration

Initial Path:

(set 'curdir (strcat acaddir "Project Files\\"))

Prompt: “Double click the location of your Existing Project, then click SAVE.”

File Type Filter: .tmp (dummy extension for directory selection)


Global Variables

Input:

  • pnl - User selection (“old”, “new”, “cancel”)

  • acaddir - AutoCAD program directory

  • curdir - Current project directory

Modified:

  • curdir - Set to selected project directory

  • pnl - May be set to “md” on cancel

Calls:

  • (new) - For new project creation

  • (dirchk) - Directory validation



Document Metadata

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


End of Document