-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Help needed: How to read substructures (e. g. CONTEXT_DATA in MULTILEADERSTYLE) #144
Comments
Hi @mme1950, The current version of |
Thank you for your reply. Do you have an idea how to read the substructures. |
Classes to implement - suggested class names:
|
Once I start working on the implementation I'll contact you with more information, right now I'm clueless. |
Do you prefer to do implemention yourself? I would be interested to do it if you do not mind. It seems that the reader infrastructure does not yet support these substructures. I did not find any examples such cases in the code. |
Of course! open a PR into this repo and I'll be happy to review it. If you need any help with the code or you have any doubt about the existing code I'll be happy to help. |
Hi @DomCR,
Are we sure that the availabele documentation is correct? Perhaps it it wise to create leaders and multileaders in AutoCad an check the values. BTW: Should not all enum types be in |
Hi @mme1950, About the documentation, I use the dxf online documentation in this link and the files in the reference folder. "Are we sure that the availabele documentation is correct?" Autodesk documentation is a mess... not always match with what's in reality, all the projects that work with dwg/dxf have the same issues. "create leaders and multileaders in AutoCad" is actually the best way to test it, I would suggest to create a sample and add the path to the test project, I'll add the instances in the samples that the project use for the generic testing, keep in mind to save the file in different versions so you make sure that works for all of them. "Should not all enum types be in namespace ACadSharp.Types?" No, at some point I noticed that I had multiple enums representing the same and I decided put some of them in this namespace, it was a mistake, the folder and namespace should disappear and redistribute the enums in a more efficient way. If you have to create enums add them in the namespace where they are used, if they are used in multiple levels add them in the top one, this is how it should be. |
Hi @DomCR,
Too many inconsistencies to proceed with trial and error. |
Next step: Reading LEADER, LEADER_LINE substrucures succeeds.
|
Hi @mme1950 To read the fields you can also use the Note: if you need to check values by hand, you can use the static method |
Feel free to create the PR with your changes anytime, that way I would be able to check the code and help you if you needed. |
Hi @DomCR, the Explore method seems to be very helpful. I should have noticed it before. Anyhow, I made a similar approach. I scanned the data stream in bit-steps to find the offset of fields with expected values found in the DXF export. I now reached the end of the MultiLeader data, and it seems that I sccessfully read all properties for the an MuliLeader with MTEXT content. Now I am trying to read a MultiLeader with BlockContent. An I see a very strange effect: I do not fully understand the magic behind the different readers. Now I saw that in |
using |
I found my problem: I missed to read one handle. All following handles received the value of the respective preceding handle. |
I think I cannot push anything into the branch you opened because I have no rights. @DomCR Can you grant me the rights to push changes. |
Push directly to master then it will be easier. |
@DomCR - I am back from holyday. Hi Albert, |
You can create a PR directly to this repo pointing to master, once you have the PR ready I'll review it. |
@DomCR |
create a fork of this Repo, make the changes in your fork and then push them into master, this should do the trick. |
seems starnge to me |
This is the usual way to go when you want to collaborate into another repo. |
OK, I did no know that. We forked the repository. |
Hi @mme1950, I've seen that you opened 2 PRs pointing to this repo but you've closed them right away, are you still interested in collaborating with this project or will you be developing your own fork? |
Sorry, this was a mistake. We are, of course highly interested, to get your comments and feedback. How is the normal process to take over the changes in the forked project into the main project? Currently, we still have to investigate some problems. Data we read from DWG and we see in DXF seem to be different from what we see in AutoCAD. Obviously the description of the group code in dPDF document is not correct. |
Hi @DomCR, |
The usual process goes by this steps:
I've found a couple sites that explain this process in more detail, hope that helps: |
@DomCR Thanks! We still have to solve some problems. Then we will craete a PR. |
You can open the PR whenever you feel ready, you have the option to setup the PR as a Draft for an incomplete feature. |
Hi @DomCR |
Hi @DomCR, In the MLEADER table I find the Version "R2010+" before the first field to read. I doubt that it means that all following fields were not present before R2010. In the MLeaderAnnotContext table version infos seem to be more reasonable. A section labelled with "R2010" is ended by "Common". However, the "end reprat" over leader-root fields is marked with "R2010" while the "begin repeat" is not. |
Hi @mme1950 About the versions you can check the class
That's what it means, the version indicates the fields that are only used for that version specifically, sometimes they are in a different order. I would recommend to copy the lines from the PDF to the code so you don't make any mistake when adding the conditional for the versions, is a slow process because you have to handle each version separately but that's the only way to go. |
Hi @DomCR, So the -R2007 seems to be wrong. I simply ommit the Arrowhead list. |
Hi @DomCR, general remark: However, in the Clone method of other entities, e.g. MText the style is cloned. |
Yes that's how they work, but they need to be cloned because the clones will be detach from the I know that this is counter intuitive and less practical when programming but by now is the only way to ensure the file integrity. |
The minus sing is before when in all other cases is after the year, may be a typo in the PDF document, I haven't check the values myself bug it would make sense. |
At least one of the two collections following the -R2007 do not apperar in the current-verision DWG. Thus it seems to make sense that -R2007 means until R2007. The Arrowhead collection may be an obsolete concept to specify individual arrowheads for each LeaderLine. After R2010 Arrowheads can be associated with each LeaderLine. But how was it between R2007 and R2010? |
I'm sorry but I don't have an answer to that, you can try to find the documentation for the DXF format for this specific years and compare it to the current one. You can try to look in https://help.autodesk.com/ but the older versions don't appear, the oldest that I could find changing the year in the URL was https://help.autodesk.com/view/ACD/2015/ENU/ |
I do not fully understand the implication of this rule. Must all referenced objects be cloned?
|
The pdf document says that the MultiLeader entity was introduced with version 21 = AC1014 = R13_14Only, i.e. before AC1021 =R2007. I did not find anything about R2007. |
Thank you very much, |
Hi @DomCR From DXF-Documentation we can see:
Using the specification in the PDF OpenDesign_Specification_for.dwg_files_ wie can read DWG files created by the current AutoCAD 2023 version. Conclusion:
|
Hi @mme1950, to address this version incompatibility the methods |
OK, this is how I implemented it. |
We are using this very fine library to write a DWG-to-SVG converter preserving DWG structures such as BlockRecords.
We need to read MULTILEADER entities. A reader for MULTILEADER entities is currently not available.
We started implementing readers by creating a reader for MULTILEADERSTYLE objects. We are getting more and more into it and found that it was quite easy to understand after all.
The MULTILEADER entity, however, contains sbstructures such as CONTEXT_DATA {} and a list of LEADER objects etc.
Can anyone give a hint how to start reading a substructure.
The text was updated successfully, but these errors were encountered: