Is there a way to create drafting notes with the current preferences (eg. arrow head typ of leader) using DraftingNoteBuilder?
I can call the legacy UF_DRF_ask_preferences to get all preferences, but I would prefer not mixing up both APIs if possible.
So, the DraftingNoteBuilder does not use your current preferences? What result are you getting that you do not like?
As far as the mentioned arrow is concerned: I don't get the arrowhead that was set in the preferences.
When I use DraftingNoteBuilder I get always the same arrowhead no matter what is set in preference. If I check the preferences with UF_DRF_ask_preferences it gives the right values.
If this affects other preferences too, I did not check. So this may be an issue only with part->Annotations()->CreateLeaderData().
Odd, I'd think that the builder would pick up on the part preferences automatically, but apparently this is not the case.
You can query the part's preferences by going through the .Annotations.Preferences property. Something like:
Doing this for every aspect of the dimension style will get tedious... There must be a better way.
I didn't find the time to check other properties .
But for the arrow type:
As cowski1 mentioned, I can query it with:
NXOpen::Preferences::AnnotationPreferences *annotPrefs = part->Annotations()->Preferences(); NXOpen::Annotations::LineAndArrowPreferences *lineAndArrowPreferences = annotPrefs->GetLineAndArrowPreferences();
NXOpen::Annotations::ArrowheadType type = lineAndArrowPreferences->FirstArrowType();
But even this is a mess because the builder expects an other enum value
which has not even the same members and int values.