Skip to content

Version 0.1.11

Latest

Choose a tag to compare

@Jones-peter Jones-peter released this 03 Jan 07:20

Release Notes

Version 0.1.11

Closes: The issue #5

Thank you @JMolina1982 for addressing this feature

New Features

Drawing Properties Management

Complete Python wrapper for AutoCAD drawing metadata with 30+ methods for managing drawing properties.

  • Full CRUD operations for custom properties
  • Support for general, summary, and custom property management
  • Seamless integration with AutoCAD COM interface

VBA to Python Equivalents

Simplify your migration from VBA to Python with direct equivalents:

  • cad.properties.get_num_custom_info() - Python equivalent for VBA ThisDrawing.SummaryInfo.NumCustomInfo
  • cad.properties.add_custom_property() - Python equivalent for VBA SetCustomByKey()
  • Complete property management methods for seamless VBA migration

Properties Class Methods

General Properties (10 methods)

Manage basic document metadata:

  • get_title() / set_title() - Document title
  • get_subject() / set_subject() - Document subject
  • get_author() / set_author() - Document author
  • get_keywords() / set_keywords() - Document keywords
  • get_comments() / set_comments() - Document comments

Summary Properties (6 methods)

Manage document summary information:

  • get_manager() / set_manager() - Project manager
  • get_company() / set_company() - Company name
  • get_category() / set_category() - Document category

Statistics (5 read-only methods)

Access document statistics:

  • get_creation_date() - Date document was created
  • get_modified_date() - Date document was last modified
  • get_last_saved_by() - User who last saved the document
  • get_edit_time() - Total edit time in seconds
  • get_revision_number() - Document revision number

Custom Properties (7 methods)

Full custom property management:

  • get_num_custom_info() - Get count of custom properties
  • get_all_custom_properties() - Retrieve all custom properties as dictionary
  • add_custom_property(key, value) - Add new custom property
  • get_custom_property(key) - Get specific custom property value
  • remove_custom_property(key) - Remove a custom property
  • update_custom_property(key, value) - Update existing custom property
  • clear_all_custom_properties() - Remove all custom properties

Code Improvements

  • Error Handling - Full error handling with CADException for all property operations
  • Documentation - Comprehensive docstrings for all methods
  • Type Hints - Full type hints for better IDE support and code intelligence
  • Exception Messages - Try-except blocks with meaningful error messages
  • Integration - Seamless integration with main AutoCAD class via cad.properties property

Testing

  • 5 comprehensive test functions covering all property operations
  • Test coverage for general properties, summary properties, statistics, and custom properties
  • Complete workflow testing for property CRUD operations

Usage Example

from AutoCAD import AutoCAD

cad = AutoCAD()

# Access general properties
cad.properties.set_title("My Drawing")
cad.properties.set_author("John Doe")

# Work with custom properties
cad.properties.add_custom_property("ProjectCode", "PROJ-001")
cad.properties.add_custom_property("DrawingType", "Structural")

# Get custom properties
num_custom = cad.properties.get_num_custom_info()
all_props = cad.properties.get_all_custom_properties()

# View document statistics
created = cad.properties.get_creation_date()
modified = cad.properties.get_modified_date()
revisions = cad.properties.get_revision_number()

Breaking Changes

None. This release is fully backward compatible with previous versions.

Requirements

  • Python 3.8 or later
  • AutoCAD 2010 or later
  • Windows OS (for COM support)
  • pywin32

Contributors

License

MIT License - See LICENSE for details


For detailed API documentation, visit: https://jsweb-tech.github.io/AutoCAD/