-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync Branch 20240619 mme #6 support dynamic blocks read evaluation graphs and block visibility parameters #419
Merged
DomCR
merged 20 commits into
DomCR:master
from
nanoLogika:20240619_mme_#6-support-dynamic-blocks-read-evaluation-graphs-and-block-visibility-parameters
Nov 4, 2024
Merged
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
a691804
- Incomplete implementation of readers for EvaluationGraph and Block…
mme1950 a8425f0
Add files via upload
nka1994 2bc9e21
Merge remote-tracking branch 'origin/master' into 20240619_mme_#6-sup…
c8f5949
- EvauationGraph derived from NonGraphicalObject
mme1950 badf13d
Merge branch '20240619_mme_#6-support-dynamic-blocks-read-evaluation-…
mme1950 7ed035b
Merge branch 'master' into master
mme1950 d74aec5
Merge branch 'master' into 20240619_mme_#6-support-dynamic-blocks-rea…
mme1950 e1457dc
Merge branch 'master' into master
mme1950 0a33fa7
Merge branch 'DomCR:master' into master
mme1950 32d7a66
Merge branch 'master' into master
mme1950 77c1df1
Merge with main
3b69413
Merge branch 'DomCR:master' into master
nka1994 8df9190
Merge branch 'DomCR:master' into master
nka1994 d9151fd
Merge branch 'master' into 20240619_mme_#6-support-dynamic-blocks-rea…
a268de1
Update README.md
7f1029f
Restore README.md
40030b8
Fix Clone Function
e49cf9a
Improve Clone of EvaluationGraph
7722e60
Repair Clone List
e691e5b
Repair Clone List of SubBlock
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,74 +1,9 @@ | ||
ACadSharp    [](https://coveralls.io/github/DomCR/ACadSharp?branch=master) | ||
--- | ||
# ACadSharp forked from https://github.com/DomCR/AcadSharp. | ||
|
||
C# library to read/write cad files like dxf/dwg. | ||
This fork is used to implement contributions to DomCR/AcadSharp. | ||
|
||
### Features | ||
The _master_ branch is kept synchronized with the _master_ in DomCR/AcadSharp. | ||
|
||
ACadSharp allows to read or create CAD files using .Net and also extract or modify existing content in the files, the main features may be listed as: | ||
A _merged_ branch (https://github.com/nanoLogika/ACadSharp/tree/7-merged-branch-for-acadsvg) is maintained containing all contributions being processed as needed for https://github.com/nanoLogika/ACadSvg etc. | ||
|
||
- Read/Write Dxf binary files | ||
- Read/Write Dxf ASCII files | ||
- Read Dwg files | ||
- Write Dwg files | ||
- Extract/Modify the geometric information from the different [entities](https://help.autodesk.com/view/OARX/2021/ENU/?guid=GUID-7D07C886-FD1D-4A0C-A7AB-B4D21F18E484) in the model | ||
- Control over the table elements like Blocks, Layers and Styles, allows you to read, create or modify the different tables | ||
|
||
For pdf export check :construction: [ACadSharp.Pdf](https://github.com/DomCR/ACadSharp.Pdf) :construction:. | ||
|
||
#### Compatible Dwg/Dxf versions: | ||
|
||
| | DxfReader | DxfWriter | DwgReader | DwgWriter | | ||
------ | :-------: | :-------: | :-------: | :-------: | | ||
AC1009 | :x: | :x: | :x: | :x: | | ||
AC1012 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | | ||
AC1014 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
AC1015 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
AC1018 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
AC1021 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | | ||
AC1024 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
AC1027 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | | ||
AC1032 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | ||
|
||
Code Example | ||
--- | ||
|
||
```c# | ||
public static void Main() | ||
{ | ||
string path = "sample.dwg"; | ||
CadDocument doc = DwgReader.Read(path, onNotification); | ||
} | ||
|
||
// Process a notification form the reader | ||
private static void onNotification(object sender, NotificationEventArgs e) | ||
{ | ||
Console.WriteLine(e.Message); | ||
} | ||
``` | ||
|
||
For more examples [check](https://github.com/DomCR/ACadSharp/tree/master/src/ACadSharp.Examples). | ||
|
||
For more information visit the :construction: [wiki](https://github.com/DomCR/ACadSharp/wiki) :construction: . | ||
|
||
Building | ||
--- | ||
Before building run: | ||
```console | ||
git submodule update --init --recursive | ||
``` | ||
This command will clone the submodules. These are Shared Projects that this project dependes on. | ||
|
||
Contributing | ||
--- | ||
|
||
Please feel free to fork this repo and send a pull request if you want to contribute to this project. | ||
|
||
Notice that this project is in an alpha version, not all the features are implemented and there can be bugs due to this so any PR with a bug fix will not have a priority. | ||
|
||
If you want to contribute you can check the Dxf documentation [here](https://help.autodesk.com/view/OARX/2021/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3). | ||
|
||
License | ||
--- | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](https://github.com/DomCR/ACadSharp/blob/master/LICENSE) file for details |
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
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
42 changes: 42 additions & 0 deletions
42
src/ACadSharp/IO/Templates/BlockVisibilityParameterTemplate.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,42 @@ | ||
using System.Collections.Generic; | ||
|
||
using ACadSharp.Entities; | ||
using ACadSharp.Objects; | ||
|
||
namespace ACadSharp.IO.Templates { | ||
|
||
internal class BlockVisibilityParameterTemplate : CadTemplate<BlockVisibilityParameter> { | ||
|
||
public BlockVisibilityParameterTemplate(BlockVisibilityParameter cadObject) | ||
: base(cadObject) { | ||
} | ||
|
||
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 override void Build(CadDocumentBuilder builder) { | ||
base.Build(builder); | ||
|
||
foreach (var cadObjectHandle in this.TotalEntityHandles) { | ||
ulong handle = cadObjectHandle.Key; | ||
if (builder.TryGetCadObject(handle, out Entity entity)) { | ||
this.TotalEntityHandles[handle] = entity; | ||
this.CadObject.Entities.Add(entity); | ||
} | ||
} | ||
|
||
foreach (var subGroup in this.CadObject.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
|
||
using ACadSharp.Objects; | ||
|
||
namespace ACadSharp.IO.Templates { | ||
internal class EvaluationGraphTemplate : CadTemplate<EvaluationGraph>{ | ||
|
||
public EvaluationGraphTemplate(EvaluationGraph evaluationGraph) | ||
: base(evaluationGraph) { | ||
} | ||
|
||
public IDictionary<EvaluationGraph.GraphNode, ulong> NodeHandles { get; } = new Dictionary<EvaluationGraph.GraphNode, ulong>(); | ||
|
||
public override void Build(CadDocumentBuilder builder) { | ||
base.Build(builder); | ||
|
||
foreach (EvaluationGraph.GraphNode node in this.CadObject.Nodes) { | ||
var nodeHandle = this.NodeHandles[node]; | ||
if (builder.TryGetCadObject(nodeHandle, out CadObject nodeObject)) { | ||
node.NodeObject = nodeObject; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not be modified.