Skip to content
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

#230 fixed #243

Conversation

mme1950
Copy link
Contributor

@mme1950 mme1950 commented Jan 6, 2024

  • Leader: new property AssociatedAnnotation
  • CadLeaderTemplate: implementation added: Build

- CadLeaderTemplaate: implementation added: Build
ACadSharp/Entities/Leader.cs Outdated Show resolved Hide resolved
}
if (builder.TryGetCadObject(this.AnnotationHandle, out Entity annotation)) {
leader.AssociatedAnnotation = annotation;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The annotation is always present? if it is, it would be good to have an else with a log using the notification method so the user knows why the annotation is missing when the reader finishes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you provided the getTableReference method for table references. Shoud we implement a similar method for Entity references?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure but I think that some entity references may have a null value, so I'm not sure that this method needs to be implemented, that's why I'm asking if the AssociatedAnnotation can be null or not, because if it can, there is no need to notify anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I do not know. I suppose it is null when no annotation is associated with the leader.
I currently cannot check in AutoCAD, whether it is possible to create a LEADER without annotation.
The annotation (typically an MTEXT) of a LEADER appears as a separate object in the DWG.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... because if it can, there is no need to notify anything.

I thought the notification is issued when a reference was read that cannot be resolved.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, that's why I've asked if this parameter is optional, because if it is, not finding the value or assigning a null value is a valid resolution for the reference and should not be notified as an error or warning.

@mme1950
Copy link
Contributor Author

mme1950 commented Jan 8, 2024

We checked it with AutoCAD:
It is possible to create a LEADER without annotation. Then the field does not appear in DXF.
In this case the AssociatedAnnotation property should be null.

@DomCR
Copy link
Owner

DomCR commented Jan 9, 2024

Perfect! merging this PR.

Good work!!

@DomCR DomCR merged commit a039d42 into DomCR:master Jan 9, 2024
2 checks passed
@DomCR DomCR linked an issue Jan 9, 2024 that may be closed by this pull request
@mme1950 mme1950 deleted the 20231229_mme_2-domcr-acadsharp-leader-style-handle-not-resolved-associatedannotation-missing-230 branch February 10, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leader: Style-Handle not resolved, AssociatedAnnotation missing
2 participants