Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

NX11.0 ______ NXOpen: clean History 2

Status
Not open for further replies.

Pjone kenobi

Mechanical
Sep 19, 2018
44
0
0
FR
Hi,

I try to clean my history in a NXOpen program but I can't find the good way because I can't use the journal.
I code my Program in C# (but i can use vb). Could you help me?

In advance, thanks a lot for your help.

B/R
 
Replies continue below

Recommended for you

What do you mean by "cleaning the history" (part history or the list of recently opened files in NX)? What are you trying to accomplish?

"I can't use the journal."
No journal will run for you? You found a specific journal, but can't get it to run? Something else?

www.nxjournaling.com
 
Hi cowski!
First, thanks for your help.

What I mean by cleaning the history is to clear the list of recently opened files in NX.
I try to read the code with the journal but it's empty...that's why i ask some help :)
 
Close NX then delete (or rename, if you want the option to recover it later) the history.pax file found in {user folder}\AppData\Local\Siemens\NX110 folder (this assumes the default install location - find the corresponding location if you have customized your install). Restart NX, it will create a clean (empty) history.pax file.

www.nxjournaling.com
 
Cowski,
Ok for the .pax file but it's not the way I want to follow...

What I try to do: I use a NXOpen program to open and close a lot of part. If my user check on his history, he can see the opened parts and I don't want. So I try to find a solution for cleaning this history with a NXOpen command to put it at the end of my NXOPen program (dll)

Many thanks.

B/R
 
The .pax file is really an XML file; the .net framework has tools to help you read/write to XML files. I'm not sure how (or if it's possible) to force the history palette to update (to changes in the pax file) while NX is running. I know that it will update the next time NX is started; I suspect that NX reads the history.pax file at startup and holds the information in memory.

www.nxjournaling.com
 
Just curious. What would be the reason why you don't want them to see the recently opened parts?
Because, as a User, that would really tick me off. I would want to be able to continue working on the part(s) where I left off the day before.

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
@cowski: thanks I will follow this way and try to find a NXOpen command to manage it.

@Nutace: It's simple, in my program I must open all the part of my assembly (250 parts), of course, it will take a long time and my user will launch it on the nigth. When it will be finish, the history list will be full and not pleasant to use...

@both: have a nice day!

B/R
 
Looks to me that there is something wrong with your program then. If I open an assembly with 250 parts, I don't see all those parts in my history.
Only the assembly will show there.
Are you opening all the parts one by one for some reason?

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
Pjone kenobi said:
Yes, I modify an attribute

But for that you don't have to open each part separately. You just open the assembly, cycle through it and make each component workpart and modify the attribute.
Just thinking about a different approach here to avoid coding which is not neccesary... ;)

Ronald van den Broek
Senior Application Engineer
Winterthur Gas & Diesel Ltd
NX9 / TC10.1.2

Building new PLM environment from Scratch using NX12 / TC11
 
I agree with NutAce.
In your code, change your load options (if necessary) to open all components and turn off partial loading. As long as you have a valid reference to a fully loaded part, you can change the part attributes. You don't even need to make it the work or display part.

Also note that if you don't need access to the NX UI, you can change your code to run in "batch mode". This might speed it up a little since the graphics won't be shown; and I'm not 100% certain, but I think the parts you open won't show up in the history.

www.nxjournaling.com
 
Hi,

Sorry for my late reply but I was out of my office.
I understand what you mean exactly, but I'm a rookie in NXopen programming so the only way I found is I open all the part I have in my folder to change the attribute. To save time I used a different loadoption.
See below:
foreach (var item in files)
{
try
{
theSession.Parts.LoadOptions.ComponentsToLoad = NXOpen.LoadOptions.LoadComponents.None;

//theSession.Parts.LoadOptions.UsePartialLoading = false;

//theSession.Parts.LoadOptions.UseLightweightRepresentations = false;

theSession.Parts.LoadOptions.SetInterpartData(false, NXOpen.LoadOptions.Parent.All);
Part thePart = theSession.Parts.Open(item, out PartLoadStatus tyty);

thePart.SetUserAttribute("Folder_Attribute", -1, Folder, Update.Option.Now);

thePart.SetUserAttribute("Numero", -1, numero, Update.Option.Now);


thePart.Save(BasePart.SaveComponents.False, BasePart.CloseAfterSave.False);
Utilities.Echo("Fichiers modifiés " + item);
theSession.Parts.CloseAll(NXOpen.BasePart.CloseModified.CloseModified, null);
theSession.ApplicationSwitchImmediate("UG_APP_NOPART");
goto end;
}
}
catch (Exception exe)
{
//NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, exe.ToString());
}

}
 
Status
Not open for further replies.
Back
Top