Conversation
…nd round-trip operations
| case XDataValueKind.ZeroHandling: | ||
| return ZeroHandling.SuppressZeroFeetAndInches; | ||
| case XDataValueKind.LineType: | ||
| return ensureLineType(doc, "LT_TEST"); |
There was a problem hiding this comment.
I still have to think about the best way to implement this, by now I leave some notes that I think it will help you to avoid code repetition.
The ensure methods could be replaced for Table.TryAdd it works in the same way and is directly implemented in all the tables.
| private static string getDumpFolder() | ||
| { | ||
| var folder = Path.Combine(TestVariables.OutputSingleCasesFolder, "dim_style_overrides"); | ||
| Directory.CreateDirectory(folder); |
There was a problem hiding this comment.
The folder creation should be initialized in TestSetup is it giving trouble in ryder?
| } | ||
| } | ||
|
|
||
| public enum XDataValueKind |
There was a problem hiding this comment.
This enum is repeated, DxfCode enum contains all this fields, look for ExtendedData at the end, starts with the value 1000.
You can also check the classes in XData folder for the dedicated classes for each type fo data.
|
|
||
| namespace ACadSharp.Tables; | ||
|
|
||
| public sealed class DimensionStyleOverride |
There was a problem hiding this comment.
Check the class DxfMap it creates this exact same structure and there is already methods to get and set the values for CadObjects.
| @@ -108,7 +108,29 @@ public ExtendedData Get(AppId app) | |||
| /// <param name="value">ExtendedData object.</param> | |||
| public bool TryGet(AppId app, out ExtendedData value) | |||
There was a problem hiding this comment.
Good point with this method, I would use directly the name such as:
return this.TryGet(app.Name, out value);I see some other errors in this class like public void Add(AppId app, IEnumerable<ExtendedDataRecord> records) is not checking that the AppId is in the document.
|
Proposal for this implementation: Dimension Methods: if style == null
//Remove Extended data entry DSTYLE
else
//1 Create DxfMap for dimstyle
DxfMap.Create<T>
//2 Compare Dimension.Style vs override style using DxfMap
foreach p in DxfMap.DxfProperties
if p.value(style) != p.value(override)
//Add to extended data
else
//continue
//End: have the edata updated using the dim override as a parameter
Method setps: if override == null => return null;
//Clone current style
//Map the properties from edata into a dxfmap
//override de edata values into the clone
return the cloneLet me know what you think about this approach. |
Description
Implemented overrides for DimensionStyle in Dimension.cs
Related Issues / Pull Requests
Notes for reviewer