Repository navigation
Conversation
…r-optional-fields-optimization
…reate-missing-layers Create layers referenced by DXF entities but missing from the LAYER table
Moved Wall and WallJustification to new AecEntities namespace with a new AecEntity base class. Updated all references to the new namespace. Refactored CadHeader to flatten property structure and improve property handling. Added constructors to ImageDefinition and VisualStyle. Updated LwPolyline to accept IVector for vertices.
…om/DomCR/ACadSharp into internal-visible-ACadSharp.Formats
Replaced ACadSharp.Entities.AecObjects with ACadSharp.Entities.AecEntities. Added new using directives for ACadSharp.IO, System.IO, System.Linq, Xunit, and Xunit.Abstractions to support additional functionality and testing.
The Trace constant ("AcDbTrace") was removed from the DxfSubclassMarker class in DxfSubclassMarker.cs as it is no longer needed.
Refactored the ExplodePattern and emitDashedSegment methods in the Hatch class to return IEnumerable<Line> instead of IEnumerable<Entity>. Updated all related variables and logic to handle only Line entities, ensuring the output is restricted to lines rather than any entity type.
…om/DomCR/ACadSharp into internal-visible-ACadSharp.Formats
Set Hatch.Style default to HatchStyleType.Normal for clarity. Removed unused MPolygon-related comments to clean up code.
…ormats Add InternalsVisibleTo for ACadSharp.Formats assembly
Introduce AssertRoundtrip property to SingleCaseGenerator, enabling custom assertions on CadDocument after roundtrip operations. Update SingleLine test to use this mechanism and invoke it in DwgWriterSingleObjectTests, allowing more flexible and targeted validation in tests.
Renamed Has to HasVertices in MLineFlags for clarity, added None = 0, and improved XML documentation. Updated DwgObjectReader to use HasVertices flag.
Replaces flat SegmentIndex/StartEndPointPairs in LeaderLine with a BreakInfo class and a list of BreakInfo entries. Updates reading, writing, cloning, and document assignment logic to support multiple break info entries per leader line, improving structure and clarity.
Set default values for key MultiLeader and MultiLeaderObjectContextData properties to ensure valid initial states. Refactor LeaderContentType enum for clarity. Update DwgObjectReader to use _mergedReaders for color reading. Simplify DwgObjectWriter logic for writing leader roots and annotation context data. Perform minor code cleanup.
Add conditional logic for R2007Pre arrowhead handling in DwgObjectWriter. Refactor CadMLeaderTemplate for clarity: mark as internal, improve formatting, streamline constructors and build method, and clarify attribute handle resolution. Add placeholder for ArrowheadHandles processing.
Made CadDictionaryTemplate public, refactored constructors, and improved the build method for better root dictionary handling, entry resolution, and error notifications. Cleaned up redundant code for clarity.
Improve hatch DXF serialization for optional patterns and gradients, including gradient properties, colors, and supported-version handling. Initialize gradients when reading R2004+ DWG data, make pattern output null-safe, and add DXF generation to `LocalSampleTests`.
…list Issue/1342 solid3d material list
Use generic `readSurfaceEntity<T>` dispatch for each surface type and instantiate the correct concrete type during modeler geometry parsing, preserving existing SAT and surface-specific handling.
- Add shared ACDSDATA, ACIS/modeler geometry, proxy, surface, and AEC support. - Expand DWG/DXF readers, writers, round-trip coverage, and malformed-data handling. - Improve entities, dimensions, multileaders, dictionaries, styles, and API validation. - Update configuration, contribution guidance, versioning workflow, and project version. - Deprecate legacy Prototype 1b data APIs while retaining reader compatibility.
Omit default layer, linetype, scale, and visibility values. Serialize line weight only for AC1015+ when non-ByLayer. Reformat `LineWeightType` without changing its values.
Reformat table-writing code and add explicit `this.` qualification without changing serialization behavior.
…l-fields-optimization Issue/1083 dxfwriter optional fields optimization
- Move shared DWG reader functionality into `DwgStreamReaders` - Expand reader and writer support for values, colors, dates, handles, and text - Update factories and merged streams across DWG versions - Preserve trailing data when reading ACIS geometry - Add conditional stream diagnostics and exploration helpers
Read ACIS version-2
Owner
|
Hi @Sring65, this PR is not valid to be merged sorry. |
Lazily initialize extended data and reactors, preserve default layer and line type behavior, register defaults on document assignment, and make extended-data storage non-reassignable.
Avoid initializing reactors and extended data when cloning `CadObject`. Make reactor removal and clearing null-safe, and ensure `SetPositionByFlag` marks the DWG stream as non-empty.
Allow zero Insert scale factors in the object model while normalizing them to `1.0` for DWG output. Add roundtrip coverage, validate MText transparency values, and make reactor cleanup null-safe.
Lazily initialize `_reactors` in `AddReactor` before adding reactors, and improve spacing in `CleanReactors`.
Drop validation of positive, negative, and zero scale values from the InsertTest class.
Use typed cloning for layer, linetype, and material references while preserving null backing fields. Add lazy `LineType.Continuous` defaults and safely handle reference removal during document assignment and unassignment.
Optimize lazy CAD object state initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resubmission
The work is rebased onto the current master (v3.8.27,
29137f3a) andre-verified end-to-end.
TransformByproducing wronggeometry) is fully resolved by this change set.
Dependency: DomCR/CSUtilities PR #29
This PR depends on a companion change in DomCR/CSUtilities — a fix to the
Matrix3(Matrix4)constructor, which was copying the linear part transposed,so every derived transform came out mirrored. Without it, the transform fixes
in this PR (ellipses, text rotation, arc angles, spline tangents) are wrong.
fbf0723(one commit ahead ofDomCR/CSUtilities master; that commit is exactly the PR updated readme #29 change)
src/CSUtilitiessubmodule in this PR is pinned atfbf0723; the.gitmodulesURL currently points at my fork (Sring65/CSUtilities) so thepin resolves immediately. Please merge the CSUtilities change first, or let
me know and I will re-point
.gitmodulesatDomCR/CSUtilitiesonce updated readme #29lands.
What's fixed
R2007 (AC1021) DWG write (new functionality; addresses the "AC1021 throws" part of #1323)
compressed stored data (previously both over compressed data → "Error
decrypting data").
uncompressed for AC1021.
maxPageSize + 32, so large preview data no longer overflows and shifts pages.Tables (AcDbTable) (addresses #1321: DWG with TableEntity that AutoCAD cannot open / table count drops)
the whole table (Error 34 eWrongObjectType).
AcDbTableStyleno longer serialized in a way that makes AutoCADAUDIT reject the file;
TableEntitycloning no longer leaves a danglingTableStyle pointer.
Dimensions & DIMASSOC
(associativity / trans_space / rotated_type / dimension object) — was reversed,
so native files' associations came out misaligned.
SHAPE
doesn't drop it.
"shape number/index <= 0".
Coordinate / transform (ApplyTransform / TransformBy) (fully resolves #854; fixes #1250)
series, Spline, TableEntity; Insert scaling/rotation; Ellipse axis vectors +
normal (with the CSUtilities Matrix3 transpose fix).
representation AutoCAD stores (fixes Arc.ApplyTransform: rotation moves the center correctly but rotates the angles backwards #1250: angles rotated backwards).
zero tangent stays absent, instead of becoming phantom points.
relative to the center (scale + rotation only).
XDATA / string encoding
Round-trip fidelity
hook line/association, PDFUnderlay scale/rotation, Text/Attrib/Shape default
omission, Wipeout clip close, HatchPattern angle, Spline nodes.
Gradient fill
order, LWDISPLAY header variable.
Object stream / handle alignment
(HardOwnership), UCS/VIEW control-object handle slots, table-style soft pointer.
Incremental save & read performance (new functionality)
objects are patched in place instead of re-serialized; a safety net falls
back to a full re-serialize if the dirty tracking cannot cover the stream.
A zero-change save is now byte-safe (previously it deterministically
corrupted the file).
events with total counts (no overhead when no consumer subscribes).
Commit → theme map
3fdda613588c9be2c87015192001e83c61c854ad715fd41d37adbe7030ea54fc00fbc836e6d8944078e00529Issues addressed / possibly addressed
TransformBysupport/behaviorArc.ApplyTransformrotates angles backwardsVerification
geometry, associations, and content match.
AutoCAD reference.
Reference / reproduction (test harness)
The test tool and sample files used for the verification above are in a

test-only repo, free to browse:
https://github.com/Sring65/-ACadSharpTransformertest
dwgReadWrite— .NET 10 console harness. Run with no arguments and itexecutes the full default pipeline on the included
sample.dwg(70-entitydrawing): coordinate transform (scale + rotate + translate) → DWG save to
every version AC1014–AC1032 → full document clone → per-class clone,
then prints a pass/fail report.
rt <in.dwg> <out.dwg> [version](no-op round-trip —the check behind DWG write at AC1015/AC1018/AC1024/AC1027 requires AutoCAD recovery on a no-op round-trip (AC1032 is clean; AC1021 throws) #1323),
empty <version>(empty file per version),mktypes <out.dwg>(synthetic linetypes with text fields),dump/classes/objinfo/layoutdump/inspect*(structuralinspection of read/write output).
sample.dwg, SHX shape fonts(
Aaa.shx,shape.shx— for the SHAPE fixes),sample.pdf,image.jpg.To reproduce: check out this branch, point the harness'
ProjectReferenceatyour local
ACadSharpcheckout (it currently carries an absolute path — seethat repo's README), then
dotnet build -c Releaseand run.Notes for reviewer
[FIX]/[PATCH]state the intent of each change. Behavior was verified againstAutoCAD/ODA, not line-by-line human review — extra scrutiny on the write path
is welcome.
look on the write path.
above) if that is easier to review.