cancel
Showing results for 
Search instead for 
Did you mean: 

MACRO - Font selection from PC to PC

Experimenter
Experimenter
 

I want to create a macro, for Modeling, that automatically opens the text dialog and makes selections, such as text. I want the text to be Arial Narrow. End result: User clicks on button and a dialog displays with all the pre-chosen options. The problem I’m running into is the macro seems to look at Arial Narrow as a number. The number can be something else from PC to PC. What code can I add that will help me to have Arial Narrow selected every time. 

I found this information, I think it’s relevant to my question and hopefully the answer.

NX parts use a "font table" which is a sort of database to keep track of the fonts used in the part. Each font is given an integer ID value when the font is used in the part. The font index number for a particular font can/will vary from part to part.

8 REPLIES

Re: MACRO - Font selection from PC to PC

Esteemed Contributor
Esteemed Contributor

I would re-do this as a journal.

Which should be much easier to deal with, especially when upgrading to the next NX version

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: MACRO - Font selection from PC to PC

Honored Contributor
Honored Contributor

It sounds like the intent may be to open the dialog, set specific options, and let the user take over from there. If this is the case, a journal will not help because NXOpen code cannot manipulate standard NX dialogs in that way (at least not to the best of my current knowledge).

Re: MACRO - Font selection from PC to PC

Experimenter
Experimenter

Journaling will not allow me to leave the dialog open. The most important this isthe users t have all the settings pre-selected and the text entered. Then the user will have to identify a face for placement and because modeling parts come in different sizes they will have to make adjustment with the size of text.

Re: MACRO - Font selection from PC to PC

Experimenter
Experimenter

Anyone know how to set up a macro so the font stays the same from PC to PC?

Re: MACRO - Font selection from PC to PC

Esteemed Contributor
Esteemed Contributor

Barring use of seed parts (or even if you use them) I would still write a journal that could be run in any part that will assign the fonts to the appropriate numbers in the font table as desired.

Then the macro will run correctly.

 

Maybe have the macro run the journal at the start of the macro? (I forget if macros can run journals, but I would assume so)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: MACRO - Font selection from PC to PC

Experimenter
Experimenter
This sounds interesting but not sure how to have one button execute the journal and then execute the macro, do you have any clues?

Thanks for your response.

Re: MACRO - Font selection from PC to PC

Esteemed Contributor
Esteemed Contributor

There are customer defaults and ugii_env.dat variables to handle the default font, these are the preferred methods and will always work for newly created blank parts.

Old parts will not update and you will need a journal to do that, since a macro is not flexible enough and you are likely to have to recreate it with each MR or MP.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: MACRO - Font selection from PC to PC

Honored Contributor
Honored Contributor

From looking at the macro attached to the first post, it appears that you are working with the text command in modeling (insert -> curve -> text); in this case, the font table does not seem to apply. The font table is used for all the annotations in drafting, but the modeling text function does not seem to use it. The usual drafting text control characters do not work in the modeling command. For example, entering "MY <Fn>TEST<F> TEXT" (where "n" is an integer ID used in the font table) does not change the font of the text as it does in drafting. I suspect that the macro is recording the chosen font's position in the dialog pick box, which may vary computer to computer depending on the installed fonts.

 

I know of no way to manipulate the standard NX UI dialogs through journal code. As such, the journal will NOT be able to exactly reproduce the action of the current macro (open dialog, set values, leave dialog open for user interaction). However, from your description (user picks face and resizes the text), I think this can all be rewritten using a journal. The user would be prompted to select a face and the text would be created. As a bonus, the journal may be able to place and resize the text based on the size of the face chosen.