{"id":18153945,"url":"https://github.com/chuongmep/cadpythonshell","last_synced_at":"2025-04-07T06:05:06.303Z","repository":{"id":116680072,"uuid":"470249909","full_name":"chuongmep/CadPythonShell","owner":"chuongmep","description":"An IronPython console for Autocad and Civil 3d API, include full snoop Database to explore API","archived":false,"fork":false,"pushed_at":"2025-03-04T09:59:37.000Z","size":24339,"stargazers_count":91,"open_issues_count":3,"forks_count":22,"subscribers_count":8,"default_branch":"dev","last_synced_at":"2025-03-31T05:02:57.327Z","etag":null,"topics":["addin","autocad","autocadlookup","autodesk","cad","cadpythonshell","civil3d","civil3dlookup","dynamo","ironpython","plugin","python","pythoncad","snoop"],"latest_commit_sha":null,"homepage":"https://chuongmep.com/posts/2022-04-05-Cad-Python-Shell.html","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chuongmep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"License.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-15T16:46:41.000Z","updated_at":"2025-03-22T23:12:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccf6a9f0-10ed-4ab5-9e8d-4e7dcb76314b","html_url":"https://github.com/chuongmep/CadPythonShell","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FCadPythonShell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FCadPythonShell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FCadPythonShell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FCadPythonShell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuongmep","download_url":"https://codeload.github.com/chuongmep/CadPythonShell/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601447,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addin","autocad","autocadlookup","autodesk","cad","cadpythonshell","civil3d","civil3dlookup","dynamo","ironpython","plugin","python","pythoncad","snoop"],"created_at":"2024-11-02T03:08:31.055Z","updated_at":"2025-04-07T06:05:06.297Z","avatar_url":"https://github.com/chuongmep.png","language":"C#","readme":"# CADPythonShell\n![Autocad API](https://img.shields.io/badge/Autocad%20API%202024-blue.svg) ![Platform](https://img.shields.io/badge/platform-Windows-lightgray.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n![ReSharper](https://img.shields.io/badge/ReSharper-2021.3.3-yellow) ![Rider](https://img.shields.io/badge/Rider-2021.3.3-yellow) ![Visual Studio 2022](https://img.shields.io/badge/Visual_Studio_2022_Preview_2.0-17.1.0-yellow) ![.NET Framework](https://img.shields.io/badge/.NET_6.0-yellow)\n\n[![Publish](../../actions/workflows/Workflow.yml/badge.svg)](../../actions)\n[![Github All Releases](https://img.shields.io/github/downloads/chuongmep/CADPythonShell/total?color=blue\u0026label=Download)]()\n[![HitCount](https://hits.dwyl.com/chuongmep/CADPythonShell.svg?style=flat-square)](http://hits.dwyl.com/chuongmep/CADPythonShell)\n\u003ca href=\"https://twitter.com/intent/follow?screen_name=chuongmep\"\u003e\n\u003cimg src=\"https://img.shields.io/twitter/follow/chuongmep?style=social\u0026logo=twitter\"\nalt=\"follow on Twitter\"\u003e\u003c/a\u003e\n\n![](Images/CadPythonShell.png)\n\n## 💖 Support This Project\n\nIf you like this project and want to support its development, please consider making a donation. Your contributions will help us continue to improve and maintain the project.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://donate.stripe.com/4gw5mc6lw9Ej72EfZ5\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Donate-Stripe-blue?style=for-the-badge\u0026logo=stripe\" alt=\"Donate with Stripe\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n## Introduction\n\nThis is obviously a fork of [RevitPythonShell](https://github.com/architecture-building-systems/revitpythonshell), bringing an IronPython interpreter to Autodesk Autocad,\nand it would not be possible without the great work of everyone involved with the RPS project. It's still pretty rough around the edges and provides only basic functionality at this time. I'm sharing my work so far, in the hopes that together we can expand it further.\n\nThe CADPythonShell (CPS) ,lets you to write plugins for Autocad in Python, provides you with an interactive shell that lets you see the results of your code *as you type it*. This is great for exploring the Autocad API.\n\nThe biggest limitation is that you can't deploy DLLs with custom scripts at this time and you can't subscribe to events at startup time.\n\n![](Images/Ribbon.png)\n\n## IronPython 3\n\nIronPython 3.4 uses Python 3.4 syntax and standard libraries and so your Python code will need to be updated accordingly. There are numerous tools and guides available on the web to help porting from Python 2 to 3.\n\nIronPython 3 targets Python 3, including the re-organized standard library, Unicode strings, and all of the other new features.with user upgrade from **IronPython 2** to **IronPython 3**, please follow [Upgrade from IronPython 2 to IronPython 3](https://github.com/IronLanguages/ironpython3/blob/master/Documentation/upgrading-from-ipy2.md).\n\nVarious differences between IronPython and CPython can follow at [Differences IronPython and CPython](https://github.com/IronLanguages/ironpython3/blob/master/Documentation/differences-from-c-python.md).\n\n## Features\n\n- Interactive IronPython interpreter for exploring the API\n  - With syntax highlighting and autocompletion (in the console only)\n  - Based on the [IronLab](http://code.google.com/p/ironlab/) project\n- Batteries included! (Python standard library is bundled as a resource in the `CADRuntime.dll`)\n- Full access to the .NET framework and the Autocad and Civil3D API\n- Configurable \"environment\" variables that can be used in your scripts\n- Save \"external scripts\" for reuse and start collecting your awesome hacks!\n- Run scripts at Autocad or Civil startup\n- Full **Snoop** info object Autocad or Civil3D (Database,Editor,Entity,etc,..)\n- Interactive Snoop from console with IronPython\n## Installation\n\n- Download last install stable(msi) from [Release](https://github.com/chuongmep/CADPythonShell/releases/latest)\n- Use command `PythonConsole` to open Console or use command `PythonShellSetting` to open form setting\n- See guide install detail at [How-to-Install-CadPythonShell](https://github.com/chuongmep/CadPythonShell/wiki/How-to-Install-CadPythonShell)\n\nNote : Support for 5 last version(2019-2023) Autocad or Civil 3D. Older versions can be used but will not guarantee the expected performance.\n\n\n## Basic Usage CadPythonShell\n\n- \u003ckbd\u003ePythonConsole\u003c/kbd\u003e - Open Python Console\n\n![](Images/cadpythonshell3.png)\n\n- \u003ckbd\u003ePythonShellSetting\u003c/kbd\u003e - Open Setting Config Console\n\n![](Images/configure.png)\n\nUse Snoop In Python Shell In Python Script :\n\n- \u003ckbd\u003eSnoop\u003c/kbd\u003e - Quick Snoop Object Sample In CAD or Civil3D\n- \u003ckbd\u003esn.Snoop(obj)\u003c/kbd\u003e - Snoop Object by Python Console In CAD or Civil3D\n- \u003ckbd\u003esnoop(obj)\u003c/kbd\u003e - Snoop Object by Python Console or Execute python code In CAD or Civil3D\n\nWrite Console Sample In Console :\n\n``` py\ned = doc.Editor\ned.WriteMessage(\"Hello\")\n```\n![](Images/console.gif)\n\nCreate Script Execute `ShowAlertDialog` Demo :\n\n```py\nimport clr\nclr.AddReference('acmgd')\nclr.AddReference('acdbmgd')\nclr.AddReference('accoremgd')\n# Import references from AutoCAD\nfrom Autodesk.AutoCAD.Runtime import *\nfrom Autodesk.AutoCAD.ApplicationServices import *\nfrom Autodesk.AutoCAD.EditorInput import *\nfrom Autodesk.AutoCAD.DatabaseServices import *\nfrom Autodesk.AutoCAD.Geometry import *\ndoc = Application.DocumentManager.MdiActiveDocument\ned = doc.Editor\ndb = doc.Database\n# Write Code Below\nApplication.ShowAlertDialog(\"Hello World!\")\n```\n\n![](Images/AlertDialogDemo.png)\n\nCreate Script Execute `ShowAlertDialog` Demo :\n\n![](Images/getobject.png)\n\nNote : you can see more example in folder [Script Examples](https://github.com/chuongmep/CadPythonShell/tree/dev/Script%20Examples)\n\n## Basic Usage Snoop\n\n![](Images/Snoop.png)\n\n- \u003ckbd\u003eSnoopDB\u003c/kbd\u003e - Snoop Database In CAD or Civil3D\n\n![](Images/SnoopDB.png)\n\n- \u003ckbd\u003eSnoopEd\u003c/kbd\u003e - Snoop Editor In CAD or Civil3D\n\n![](Images/SnoopEditor.png)\n\n- \u003ckbd\u003eSnoopEnts\u003c/kbd\u003e - Snoop Entities In CAD or Civil3D\n\n![](Images/SnoopEntities.png)\n\n- \u003ckbd\u003eSnoopNEnts\u003c/kbd\u003e - Snoop Entities Nested In CAD or Civil3D\n\n- \u003ckbd\u003eSnoopByHandle\u003c/kbd\u003e - Snoop By Handle In CAD or Civil3D\n\n![](Images/SnoopByHandle.png)\n\n- \u003ckbd\u003eSnoopEvents\u003c/kbd\u003e - Snoop Follow Events In CAD or Civil3D\n\n![](Images/SnoopEvents.png)\n\n## Contribute\n\n- Don't hesitate to file any issues you stumble uppon. (Tho I don't guarantee I'll be able to solve them all for you)\n\n## Getting started:\n\nLearn some python:\n\n  * [Python W3schools](https://www.w3schools.com/python/python_intro.asp)\n  * [Python Basic](https://www.python.org/about/gettingstarted/)\n\nLearn about the Autocad API:\n\n  * ADN [Autodesk Developer Network](https://www.autodesk.com/developer-network/overview)\n  * [The Autocad SDK\"](https://www.autodesk.com/developer-network/platform-technologies/autocad/objectarx)\n   \n\n## License\n\nThis project is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n## Sponsors\n\n![](Images/jetbrains.png)\n\nThanks for providing a free All product IDE for this project.\n\n## Credits\n\n  * Daren Thomas (original RPS Developer) [RPS](https://github.com/architecture-building-systems/revitpythonshell)\n  * Joe Moorhouse (interactive shell was taken from his project [IronLab](https://code.google.com/archive/p/ironlab/)\n  * [Dimitar Venkov](https://github.com/dimven/NavisPythonShell) (original port to Navisworks)\n  * [ChuongMep](https://github.com/chuongmep) (original port to Autocad)\n  * The rest of the RPS contributors\n  * [Nice 3 Point](https://github.com/Nice3point) for process CI/CD\n  * [Icon 8](https://icons8.com/) Free Wiki icons in various UI design styles for web, mobile\n  * [htlcnn](https://github.com/htlcnn) origin of project AutocadLookup\n  * [Autodesk Developer Network](https://github.com/ADN-DevTech/MgdDbg) project `MgdDbg` support full snoop database in Autocad.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuongmep%2Fcadpythonshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuongmep%2Fcadpythonshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuongmep%2Fcadpythonshell/lists"}