Skip to content

Dynamic parameters#1151

Open
DomCR wants to merge 36 commits into
masterfrom
AcDbEvalGraph
Open

Dynamic parameters#1151
DomCR wants to merge 36 commits into
masterfrom
AcDbEvalGraph

Conversation

@DomCR

@DomCR DomCR commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Description

Implement the first dynamic parameters for the dxf and dwg format.

Tasks done in this PR

  • BlockLinearGrip
  • EvaluationGraph
  • BlockRepresentationData
  • BlockLinearPrameter
  • BlockScaleAction
  • DynamicBlockPurgePreventer
  • BlockGripExpression
  • BlockLinearGrip
  • BlockLinearParameter
  • BlockMoveAction
  • BlockRotationAction
  • BlockRotationParameter
  • BlockVisibilityParameter
  • BlockLookupParameter
  • BlockPointParameter
  • EvaluationGraph
  • BlockXYGrip
  • BlockRotationGrip
  • BlockVisibilityGrip

The PR manages to create a dxf with the original dynamic block intact, but the modified instances lose the parameters relationship.

DomCR added 3 commits July 13, 2026 08:39
- Restructure EvaluationGraph.Node with renamed properties, reordered fields, and new XML docs; introduce NodeFlags enum for Flags property.
- Add EvaluationGraph.Edge class with edge data and cloning support.
- Add NodeFlags enum for node state flags.
- Update EvaluationGraph to manage Edges and Nodes lists; enhance Clone for deep copy.
- Refactor CadEvaluationGraphTemplate and GraphNodeTemplate for new structure.
- Update DwgObjectReader and DxfObjectsSectionReader to handle new Node/Edge layout and enum mapping.
- Improve code clarity, maintainability, and DWG/DXF graph representation.
- Add WriteDynamicBlockData option to CadWriterConfiguration
- Switch Edge from Id to Index for reading/writing
- Implement writing for DynamicBlockPurgePreventer and EvaluationGraph in DxfObjectsSectionWriter
- Serialize EvaluationGraph nodes and edges with DXF codes
- Extend Edge with Data1-Data5, Flags, Index, and tracking properties
@DomCR DomCR added the feature New feature added label Jul 13, 2026
DomCR added 9 commits July 13, 2026 12:01
Introduce BlockLinearGrip class with DXF attributes and parsing.
Register BLOCKLINEARGRIP in DxfFileToken and DxfSubclassMarker.
Update DWG/DXF readers to handle BlockLinearGrip objects.
Refactor grip templates to use generic CadBlockGripTemplate.
Implement ParameterValueSet parsing for linear parameters.
Adjust tests and document reading for new parameters and notifications.
Remove unused specialized grip templates and clean up code.
Refactored and improved serialization for BlockRepresentationData, DynamicBlockPurgePreventer, and EvaluationGraph. Updated DXF codes and property names for accuracy. Enhanced documentation, code style, and document assignment logic. Moved and clarified GetInstanceCount in CadDocument.
Refactored CadDocument to use internal AddCadObject/RemoveCadObject methods with improved handle and document management. Updated EvaluationGraph to manage nodes via CreateNode/RemoveNode and ensure EvaluationExpression objects are properly added/removed from the document. Enhanced DxfObjectsSectionWriter with support for additional block parameter types. Improved code clarity and documentation.
Introduced BlockScaleAction class with scale connections. Added related constants to DxfFileToken and DxfSubclassMarker. Implemented CadBlockScaleActionTemplate. Updated readers and writers for BLOCKSCALEACTION handling in DWG/DXF. Refactored BlockActionBasePt to use UpdateBaseX/UpdateBaseY. Enhanced EvalConnection with scale constants and ToString. Ensured correct serialization and deserialization of BLOCKSCALEACTION objects.
Add serialization for BlockMoveAction, BlockScaleAction, BlockPointParameter, and BlockXYGrip. Refactor to use helper methods for evaluation connections and parameter properties. Update BlockAction to remove Value70 and improve code structure by splitting logic into focused methods. Update reader to handle entity handles for block actions.
Added handling for BlockVisibilityParameter and BlockLookupParameter in the section writer. Implemented serialization for BlockLookupParameter and added a stub for BlockVisibilityParameter.
Implement serialization for BlockRotationAction, BlockRotationParameter, and BlockRotationGrip in DxfObjectsSectionWriter. Refactor BlockRotationParameter class for formatting consistency without changing its structure or properties.
Refactored BlockVisibilityParameter to use Label, added Value281, and implemented DXF writer logic for properties, entities, and states. Separated BlockVisibilityGrip with Dxf attributes. Improved State class structure and cloning for better dynamic block visibility handling.
Added reading/writing of the "Units" property (group code 70) for block records in the DXF tables section. Introduced a writeFlags parameter to control writing of the Flags property, disabling it for block records.
DomCR added 7 commits July 14, 2026 18:42
- Write handle with group code 360 if HardOwnerFlag is true, else use 350 in DxfObjectsSectionWriter
- Set HardOwnerFlag default to false in CadDictionary
- Minor formatting fix in block parameter writing
Refactored BLOCKGRIPLOCATIONCOMPONENT handling by replacing BlockGripExpression with BlockGripLocationComponent and updating related templates and IO logic. Expanded and reorganized DxfCode enum with improved documentation. Refactored GroupCodeValue utilities for clarity. Added EvaluatedValue to EvaluationExpression with DxfValuePair serialization. Improved XRecord.Entry encapsulation and cloning. Updated DXF writers to use DxfCode.Name and improved double formatting. Removed obsolete BlockGripExpression files.
- Move DxfValuePair to its own file with XML docs and namespace.
- Add EvaluatedValue property to EvaluationExpression.
- Reorder and document Connection property in BlockGripLocationComponent.
- Remove unused using directive from EvaluationExpression.cs.
Refactored code to store read values in a local variable based on group code type. Added support for Int32, Int64, and ExtendedDataInt32 using ReadBitLong(). Now assigns evaluated value to template.CadObject.EvaluatedValue as a DxfValuePair, improving correctness and extensibility.
@DomCR DomCR changed the title DxfWriter - Dynamic parameters Dynamic parameters Jul 15, 2026
DomCR added 8 commits July 16, 2026 13:38
Implement reading and writing for dynamic block parameters, grips, actions, and evaluation graphs. Add new methods in DwgObjectReader and DwgObjectWriter for these objects. Introduce DynamicBlockPurgePreventerTemplate and update DynamicBlockPurgePreventer to reference BlockRecord. Change EvalConnection.Id to int and make EvaluationExpression inherit from NonGraphicalObject. Add WriteDynamicParameters flag to control dynamic block data IO. Refactor NonGraphicalObject and update DWG writer configuration. Includes minor cleanups and documentation updates.
Introduce BlockStretchAction class and related constants. Refactor DwgObjectWriter for block action serialization and add writeParameterValueSet. Add Unknown property to EvaluationExpression and update read/write logic. Minor cleanup in DxfObjectsSectionWriter. Update BlockScaleAction structure.
- Change Block2PtParameter.GripIds from array to List<long> and update all related code.
- Update DwgObjectReader and DxfObjectsSectionReader for new GripIds handling.
- Add support for BlockStretchAction in DxfObjectsSectionReader, including a new readBlockStretchAction method.
- Move BlockStretchAction to its own file, update inheritance, and add DXF attributes.
- Reformat BlockFlipParameter for clarity; no structural changes.
- Apply minor formatting and namespace improvements.
Refactor BlockRotationAction to use EvalConnection instead of Value94/Value303. Update BlockRotationParameter to use Label/LabelOffset and consolidate value properties into ParameterValueSet. Update DWG/DXF read/write logic and add helper methods for new structures. Includes minor cleanup and method organization improvements.
Implemented serialization methods for BlockPointParameter and BlockMoveAction, including helper methods for their properties. Registered these methods in the object writing logic. Refactored BlockRotationAction serialization into a dedicated method and removed the old inline implementation for clarity and maintainability.
Refactored block parameter serialization to use more specific methods and removed redundant grip writers. Added writeBlockVisibilityParameter and writeState to support BlockVisibilityParameter and its states, updating dispatch logic accordingly.
Split monolithic methods into focused, object-specific parsing methods in DxfObjectsSectionReader. Modularized table reading logic (cells, rows, columns, content) and extracted specialized handlers for block parameters, actions, grips, evaluation graphs, and other DXF objects. Improved maintainability by distributing DXF code handling into dedicated methods, reducing duplication and clarifying responsibilities. This refactor makes the codebase more extensible and easier to debug.
Add CadBlockStretchActionTemplate for entity mapping and binding. Extend BlockStretchAction with new properties and inner classes (StretchBind, StretchNode). Update DxfObjectsSectionReader and DxfObjectsSectionWriter for BlockStretchAction handling. Apply minor refactoring and type fixes.
DomCR added 6 commits July 21, 2026 10:37
Added support for BLOCKLOOKUPACTION and BLOCKLOOKUPGRIP objects in the DXF reader and object model.
Introduced new constants in DxfFileToken and DxfSubclassMarker.
Implemented BlockLookupAction (with ColumnData) and BlockLookupGrip classes with DXF attribute mapping.
Added CadBlockLookupActionTemplate for reading/building lookup actions.
Extended DxfObjectsSectionReader to parse these objects.
Performed minor code cleanups in BlockLinearGrip and BlockMoveAction.
Implemented DWG/DXF parsing for Block Lookup and Stretch Actions.
Added new reader methods and updated switch handling.
Mapped IsLookupProperty in DXF, removed unused PropertyType,
and improved template and binding consistency.
Refactor DxfObjectsSectionWriter to use a generic writeBlockGripBase for BlockXYGrip and BlockLookupGrip. Reimplement writeBlockStretchAction to serialize all relevant properties. Rename StretchData to StretchBindings in BlockStretchAction and update references for clarity and correctness.
Add serialization for BlockLookupAction in DxfObjectsSectionWriter, including columns and rows. Update BlockStretchAction to use correct group codes for EndYDelta. Improve deserialization logic for BlockStretchAction using subclass marker.
Add serialization for BlockLookupParameter, BlockLookupAction, and BlockStretchAction in DWG writer with dedicated methods and switch updates. Fix BlockLookupAction table row writing order in DXF writer. Add minor using directives for static imports.
Moved writeBlockLookupAction and writeLookupActionColumn methods earlier in the file for better organization. No changes to logic or implementation.
@DomCR DomCR added the major Updates the major version on merge. label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature added major Updates the major version on merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant