Skip to content

Commit

Permalink
Merge pull request #1269 from mcneel/1.28
Browse files Browse the repository at this point in the history
Fix on 'Add Symbol' component.
  • Loading branch information
kike-garbo authored Jan 2, 2025
2 parents 0688a70 + e924af5 commit 647acf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 2 additions & 0 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ group: Deployment & Configs

### RC

- Fix on 'Add Symbol' component when updating element location.

{% endcapture %}

{% include ltr/release_header_next.html title="Upcoming Changes" note=rc_release_notes %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ internal static void SetLocation<T>(this T element, XYZ newOrigin, double newAng
// Set Origin
{
var translation = newOrigin - origin;
if (translation.IsZeroLength())
if (!translation.IsZeroLength())
{
if (element.Pinned) element.Pinned = false;
modified = true;
Expand Down
12 changes: 2 additions & 10 deletions src/RhinoInside.Revit.GH/Components/Annotations/AddSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,9 @@ ARDB.AnnotationSymbolType type
if (detail is null) return false;

if (detail.OwnerViewId != view.Id) return false;
if (detail.GetTypeId() != type.Id)
{
if (ARDB.Element.IsValidType(detail.Document, new ARDB.ElementId[] { detail.Id }, type.Id))
{
if (detail.ChangeTypeId(type.Id) is ARDB.ElementId id && id != ARDB.ElementId.InvalidElementId)
detail = detail.Document.GetElement(id) as ARDB.AnnotationSymbol;
}
else return false;
}
if (detail.GetTypeId() != type.Id) detail.ChangeTypeId(type.Id);

return false;
return true;
}

ARDB.AnnotationSymbol Create(ARDB.View view, ARDB.XYZ point, ARDB.AnnotationSymbolType type)
Expand Down

0 comments on commit 647acf6

Please sign in to comment.