Skip to content

Commit

Permalink
Expose PlainTextWithFields in bindings #585
Browse files Browse the repository at this point in the history
  • Loading branch information
fraguada committed Mar 5, 2024
1 parent 14971d3 commit f50dbbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/bindings/bnd_annotationbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ std::wstring BND_AnnotationBase::PlainText() const
return rc;
}

std::wstring BND_AnnotationBase::PlainTextWithFields() const
{
std::wstring rc(m_annotation->PlainTextWithFields().Array());
return rc;
}



BND_TextDot::BND_TextDot(ON_TextDot* dot, const ON_ModelComponentReference* compref)
Expand All @@ -53,6 +59,7 @@ void initAnnotationBaseBindings(pybind11::module& m)
py::class_<BND_AnnotationBase, BND_GeometryBase>(m, "AnnotationBase")
.def_property_readonly("RichText", &BND_AnnotationBase::RichText)
.def_property_readonly("PlainText", &BND_AnnotationBase::PlainText)
.def_property_readonly("PlainTextWithFields", &BND_AnnotationBase::PlainTextWithFields)
;

py::class_<BND_TextDot, BND_GeometryBase>(m, "TextDot")
Expand All @@ -74,6 +81,7 @@ void initAnnotationBaseBindings(void*)
class_<BND_AnnotationBase, base<BND_GeometryBase>>("AnnotationBase")
.property("richText", &BND_AnnotationBase::RichText)
.property("plainText", &BND_AnnotationBase::PlainText)
.property("plainTextWithFields", &BND_AnnotationBase::PlainTextWithFields)
;

class_<BND_TextDot, base<BND_GeometryBase>>("TextDot")
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/bnd_annotationbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BND_AnnotationBase : public BND_GeometryBase
//void SetPlainText(const std::wstring& text);
//public string RichText{ get; set; }
//public string PlainText{ get; set; }
//public string PlainTextWithFields{ get; }
std::wstring PlainTextWithFields() const;
//public static string PlainTextToRtf(string str) = >
//public void SetRichText(string rtfText, DimensionStyle dimstyle)
//public bool TextHasRtfFormatting{ get; }
Expand Down

0 comments on commit f50dbbd

Please sign in to comment.