-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
3,837 additions
and
1,094 deletions.
There are no files selected for viewing
Binary file not shown.
4,628 changes: 3,639 additions & 989 deletions
4,628
samples/dynamic-blocks/dynamic-block-circle.dxf
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
43 changes: 0 additions & 43 deletions
43
src/ACadSharp/IO/Templates/BlockVisibilityParameterTemplate.cs
This file was deleted.
Oops, something went wrong.
92 changes: 92 additions & 0 deletions
92
src/ACadSharp/IO/Templates/CadBlockVisibilityParameterTemplate.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using System.Collections.Generic; | ||
|
||
using ACadSharp.Entities; | ||
using ACadSharp.Objects.Evaluations; | ||
|
||
namespace ACadSharp.IO.Templates | ||
{ | ||
|
||
internal class CadEvaluationExpressionTemplate : CadTemplate<EvaluationExpression> | ||
{ | ||
public CadEvaluationExpressionTemplate(EvaluationExpression cadObject) | ||
: base(cadObject) | ||
{ | ||
} | ||
} | ||
|
||
internal class CadBlockElementTemplate : CadEvaluationExpressionTemplate | ||
{ | ||
public BlockElement BlockElement { get { return this.CadObject as BlockElement; } } | ||
|
||
public CadBlockElementTemplate(BlockElement cadObject) | ||
: base(cadObject) | ||
{ | ||
} | ||
} | ||
|
||
internal class CadBlockParameterTemplate : CadBlockElementTemplate | ||
{ | ||
public BlockParameter BlockParameter { get { return this.CadObject as BlockParameter; } } | ||
|
||
public CadBlockParameterTemplate(BlockParameter cadObject) | ||
: base(cadObject) | ||
{ | ||
} | ||
} | ||
|
||
internal class CadBlock1PtParameterTemplate : CadBlockParameterTemplate | ||
{ | ||
public Block1PtParameter Block1PtParameter { get { return this.CadObject as Block1PtParameter; } } | ||
|
||
public CadBlock1PtParameterTemplate(Block1PtParameter cadObject) | ||
: base(cadObject) | ||
{ | ||
} | ||
} | ||
|
||
internal class CadBlockVisibilityParameterTemplate : CadBlock1PtParameterTemplate | ||
{ | ||
public IDictionary<ulong, Entity> TotalEntityHandles { get; } = new Dictionary<ulong, Entity>(); | ||
|
||
public IDictionary<BlockVisibilityParameter.SubBlock, IList<ulong>> SubBlockHandles { get; } = new Dictionary<BlockVisibilityParameter.SubBlock, IList<ulong>>(); | ||
|
||
public CadBlockVisibilityParameterTemplate(BlockVisibilityParameter cadObject) | ||
: base(cadObject) | ||
{ | ||
} | ||
|
||
public override void Build(CadDocumentBuilder builder) | ||
{ | ||
base.Build(builder); | ||
|
||
BlockVisibilityParameter bvp = this.CadObject as BlockVisibilityParameter; | ||
|
||
foreach (var cadObjectHandle in this.TotalEntityHandles) | ||
{ | ||
ulong handle = cadObjectHandle.Key; | ||
if (builder.TryGetCadObject(handle, out Entity entity)) | ||
{ | ||
this.TotalEntityHandles[handle] = entity; | ||
bvp.Entities.Add(entity); | ||
} | ||
} | ||
|
||
foreach (var subGroup in bvp.SubBlocks) | ||
{ | ||
if (this.SubBlockHandles.TryGetValue(subGroup, out IList<ulong> subBlockHandles)) | ||
{ | ||
foreach (ulong handle in subBlockHandles) | ||
{ | ||
if (this.TotalEntityHandles.TryGetValue(handle, out Entity entity)) | ||
{ | ||
subGroup.Entities.Add(entity); | ||
} | ||
else if (builder.TryGetCadObject(handle, out Entity entityX)) | ||
{ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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
Oops, something went wrong.