smithery.ai

pcad-to-autocad

Guide for transpiling P-CAD code to AutoLISP and rendering it in AutoCAD.

First seen Apr 5, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,801 B
  • docs SUMMARY.md 96 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 5 installs

SKILL.md

P-CAD to AutoCAD Rendering Guide

This skill guides the process of converting P-CAD DSL code into AutoLISP scripts and automating AutoCAD to render the final drawing.

Prerequisites

  • Transpiler: f:\Uchannel\.agent\skills\image-to-pcad\scripts\pcadtoautolisp.py
  • AutoCAD: Installed on the system (typically C:\Program Files\Autodesk\AutoCAD 2021\acad.exe).
  • Workspace: Operations should ideally happen in a workspace-local folder or h:\automation_temp to avoid permission/path issues.

Step 1: Transpilation

Convert the .pcad file to .lsp using the Python transpiler.

python f:\Uchannel\.agent\skills\image-to-pcad\scripts\pcad_to_autolisp.py <source.pcad> <output.lsp>

Common issues:

  • Encoding: Ensure the .pcad file is UTF-8.
  • Python: Use python or python3 depending on the environment.

Step 2: AutoCAD Automation

AutoCAD can be automated using Script files (.scr).

1. Create a Loader Script (Auto-Generated)

The transpiler automatically generates a <source>.scr file alongside your .lsp output.

Key Features:

  • Automatic Path Handling: The .scr uses the absolute path to your .lsp file.
  • ANSI Encoding: The .scr is encoded in Windows ANSI (GBK/Latin-1) to ensure AutoCAD compatibility, even with Chinese characters in paths.

2. Launch AutoCAD with the Script

Simply drag and drop the auto-generated .scr file into AutoCAD, or use the following command:

& "C:\Program Files\Autodesk\AutoCAD 2021\acad.exe" /b "C:\path\to\AutoGenerated.scr"

Troubleshooting

numberp: nil Error in AutoCAD

This usually happens if a variable used in a barshape segment is not defined in params or derive.

  • Check: Ensure all variables in segments = [...] are either literals or defined in the global params/derive blocks.
  • Fix: Move local dims definitions to the derive block if they are needed for geometry.

Missing Fonts or Styles

If text looks wrong or "Standard" style is missing properties:

  • The transpiler automatically attempts to set TEXTFONT (default: fsdbe.shx,cadhzf.shx).
  • Ensure these fonts are in the AutoCAD font path, or modify pcadtoautolisp.py globals.

Command Not Found: PCAD_Render

  • Check if the .lsp file was loaded successfully.
  • Look at the AutoCAD command line for syntax errors during loading.

Reference Paths

Item Path
Transpiler f:\Uchannel\.agent\skills\image-to-pcad\scripts\pcadtoautolisp.py
AutoCAD EXE C:\Program Files\Autodesk\AutoCAD 2021\acad.exe
Default Output P-CAD-code\AutoGenerated.lsp