cancel
Showing results for 
Search instead for 
Did you mean: 

Use drafting preferences with DraftingNoteBuilder

Genius
Genius

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.

 

Regards

Jan Boettcher

 

Jan Böttcher
4 REPLIES

Re: Use drafting preferences with DraftingNoteBuilder

Phenom
Phenom

So, the DraftingNoteBuilder does not use your current preferences? What result are you getting that you do not like?

Re: Use drafting preferences with DraftingNoteBuilder

Genius
Genius

cowski1 wrote:

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().

 

Regards

Jan

 

 

 

Jan Böttcher

Re: Use drafting preferences with DraftingNoteBuilder

Phenom
Phenom

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:

workPart.Annotations.Preferences.GetLineAndArrowPreferences.FirstArrowType

 

Doing this for every aspect of the dimension style will get tedious... There must be a better way.

Re: Use drafting preferences with DraftingNoteBuilder

Genius
Genius

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();

 (NX9.0.3.4 C++)

But even this is a mess because the builder expects an other enum value

NXOpen::Annotations::LeaderData::ArrowheadType

 which has not even the same members and int values.

Jan Böttcher