Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IFRs on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

MR NX 8.0.3.4 - journal won't work now

Status
Not open for further replies.

moog2

Mechanical
Jan 16, 2007
441
Please help me to get this journal working again, It's one of cowski's masterpieces...
I've just put the latest maintenance pack on and it no longer works, maybe they've changed something in NX open or something...
It's the dxf creator, which exports, and imports a .cgm, and exports that.
usually you watch the drawing appear in model space, then turn white, and finish back in the drawing sheet...
Now, it flashes open the model space, then flashes a blank drawing, then goes back to the drawing sheet, and completes the dxf, without errors. But if you open the dxf, there's nothing in it and it just shows the model-space background colour.
What's weird, is i point the journal at my template part, and the background colour is different to what you see running the journal.
I've tried changing it to "Blank" but then it says it has an error in file creation.
Any help much appreciated...
 
Replies continue below

Recommended for you

There should be log files created in addition to the dxf files, do the log files report any errors?

As a guess from your description, I'd say it is not finding your specific template file (I remember we customized your version because you don't use the "blank" template). Were there any other environmental changes when you upgraded to NX 8?

www.nxjournaling.com
 
[ponder]Cowski,
Thanks again for your help, I've been using it sucessfully in NX8 on MR 8.0.2 but i put on maintenance 8.0.3 and now it no longer works.
The log file doesn't give any errors, here are a sample dxf, and log file.
You're right about pointing to my template, but i do still have the "Blank" template available,(other users don't), but when i changed the journal to read "Blank", instead of "BUSTECH.prt" it errors, saying "the selected template doesn't exist" (but it does)
So, if it can't read the "Blank" part, and it's not using my "BUSTECH.prt" template, then what is it using?
 
 http://files.engineering.com/getfile.aspx?folder=9fc76959-b22a-4c9b-b521-a45e7153cadf&file=CHAD-1501_sh1.dxf
Run the following code to see if your template is listed in the output.

Code:
[COLOR=blue]Option[/color] [COLOR=blue]Strict[/color] [COLOR=blue]Off[/color]  
[COLOR=blue]Imports[/color] System  
[COLOR=blue]Imports[/color] NXOpen  

[COLOR=blue]Module[/color] Module1  

    [COLOR=blue]Sub[/color] Main()  

        [COLOR=blue]Dim[/color] theSession [COLOR=blue]As[/color] Session [COLOR=blue]=[/color] Session.GetSession()  
        [COLOR=blue]Dim[/color] workPart [COLOR=blue]As[/color] Part [COLOR=blue]=[/color] theSession.Parts.Work  
        [COLOR=blue]Dim[/color] lw [COLOR=blue]As[/color] ListingWindow [COLOR=blue]=[/color] theSession.ListingWindow  
        lw.Open()  

        [COLOR=blue]Dim[/color] templates() [COLOR=blue]As[/color] [COLOR=blue]String[/color]  

        templates [COLOR=blue]=[/color] theSession.Parts.FileNew.GetAvailableTemplates  
        [COLOR=blue]For[/color] [COLOR=blue]Each[/color] temp [COLOR=blue]As[/color] [COLOR=blue]String[/color] [COLOR=blue]In[/color] templates  
            lw.WriteLine(temp)  
        [COLOR=blue]Next[/color]  

        lw.Close()  
    End [COLOR=blue]Sub[/color]  


    [COLOR=blue]Public[/color] [COLOR=blue]Function[/color] GetUnloadOption(ByVal dummy [COLOR=blue]As[/color] [COLOR=blue]String[/color]) [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  

 [COLOR=green]'Unloads the image when the NX session terminates[/color]
        GetUnloadOption [COLOR=blue]=[/color] NXOpen.Session.LibraryUnloadOption.AtTermination  

    End [COLOR=blue]Function[/color]  

End [COLOR=blue]Module[/color]


If you want to try to use the blank template, change the NewFile subroutine to the following (changed lines highlighted):

Code:
[COLOR=blue]Sub[/color] NewFile(fullpath [COLOR=blue]as[/color] string, units [COLOR=blue]as[/color] [COLOR=blue]integer[/color])  
	  
	Dim fileNew1 [COLOR=blue]As[/color] FileNew  
	fileNew1 [COLOR=blue]=[/color] theSession.Parts.FileNew()  
	  
	  [COLOR=green]'the template file name will be the filename as it appears in the template directory (or as listed by the "file_new_templates.vb" journal)[/color]
	  [COLOR=green]'change the fileNew1.Application to match the application launched when you start a new file with the template[/color]
	  [COLOR=green]'also, make sure the fileNew1.Units matches the part units of the template[/color]
	  [COLOR=green]'when everything matches up it should work, otherwise you will get a 'template not found' error[/color]
	  [highlight #FCE94F][COLOR=green]'fileNew1.TemplateFileName = "BUSTECH.prt" (comment this line out)[/color][/highlight]
	fileNew1.Application [COLOR=blue]=[/color] FileNewApplication.Modeling  
	fileNew1.Units [COLOR=blue]=[/color] Part.Units.Millimeters  
	  [COLOR=green]'fileNew1.Units = Part.Units.Inches[/color]
	fileNew1.NewFileName [COLOR=blue]=[/color] fullpath  
	fileNew1.MasterFileName [COLOR=blue]=[/color] ""  
	[highlight #FCE94F]fileNew1.UseBlankTemplate [COLOR=blue]=[/color] [COLOR=blue]True[/color] [COLOR=green]'change from False to True[/color][/highlight]  
	fileNew1.MakeDisplayedPart [COLOR=blue]=[/color] [COLOR=blue]True[/color]  
	  
	Dim nXObject1 [COLOR=blue]As[/color] NXObject  
	nXObject1 [COLOR=blue]=[/color] fileNew1.Commit()  
	  
	workPart [COLOR=blue]=[/color] theSession.Parts.Work  
	displayPart [COLOR=blue]=[/color] theSession.Parts.Display  
	  
	fileNew1.Destroy()  
	  
End [COLOR=blue]Sub[/color]


www.nxjournaling.com
 
cowski,
the template enquirey is finding all that it should, i then changed the lines you showed and ran the journal, it seemed to work slightly differently, and the end result is a black square, not the shaded background.
It must be something that they've changed in the MR as I've not updated the other users, and they work fine still.
Have you installed this maintenance yet?
 
 http://files.engineering.com/getfile.aspx?folder=6377db7a-55d5-46be-a8cf-b406c718b05c&file=CHAD-1501_sh1.zip
We recently upgraded to NX 8 (I'm currently running 8.0.1.5). The dxf journal is working for me, the version I'm running can be found here; this version works for both TC and native and has a few other tweaks to make it more robust. This version won't solve your problem though, as it still references the "blank" template. I'll have to talk to the guy in charge of CAD updates to see when/if we'll be installing 8.0.3.4.

www.nxjournaling.com
 
Cowski,
I've tried to run the version you linked to, but it fails to find the drawing file for some reason, but this is not to do with the maintenance update, as i tried to use it a while ago (on 8.0.2), when your journal site was only just open (nice job by the way)..
The routine then just hangs, and has to be stopped.
I wonder what is causing this not to work on my set-up, i know it works ok for other people i've spoken to...
 
 http://files.engineering.com/getfile.aspx?folder=41edd01a-5ba9-475a-b290-11dddde87923&file=failed.JPG
Let's try this: start the journal recorder and create a new file based on your bustech template then stop the journal recorder and post the resulting journal code. Perhaps we are missing a setting or two during the new file creation. (Assuming the new file creation is the problem.)

Also, run the version that is listed on the website again. That one writes information to the NX log file as it executes. After it errors out/quits working, open the NX log file (Help -> Log File) and scroll down to the end to see what information the journal has written.

www.nxjournaling.com
 
moog2,
The log file indeed indicates that it is not finding the template file. I noticed a couple of minor differences in the journal you recorded vs my journal code; I've incorporated those changes into this code, hopefully it will take care of the problem. If not, post back with a description of what happens.

www.nxjournaling.com
 
Cowski,
it still hangs i'm afraid, say's can't find the file , press a key to continue..

log says..

Part::SaveManager saved 1 parts successfully.
Adding file to kill list: X:\Paul\test-dxf\CHAD-1501_dwg_1.cgm
Adding file to kill list: X:\Paul\test-dxf\CHAD-1501_dwg_1.prt
DXF file: X:\Paul\test-dxf\CHAD-1501_dwg_1.dxf
Calling export DXF routine
ExportDXF(X:\Paul\test-dxf\CHAD-1501_dwg_1.prt, X:\Paul\test-dxf\CHAD-1501_dwg_1.dxf)
Teamcenter Integration: capability TC_is_Teamcenterized is disabled
DXF/DWG Export: Export translation job submitted.Waiting on creation of DXF file...
&MACRO FOCUS CHANGE OUT 1
&MACRO FOCUS CHANGE OUT 1
&MACRO FOCUS CHANGE IN 1
&MACRO MENU, 0, UG_HELP_SYSTEM_LOG UG_GATEWAY_MAIN_MENUBAR ! <MB/Toolbar>
Successfully loaded dynamic module C:\Program Files\Siemens\NX 8.0\UGII\libhelpint.dll
Loaded module C:\Program Files\Siemens\NX 8.0\UGII\libflat.dll 7fef22b0000 75000 f88380c4-4559fe44-6961059c-64842caf-1=libflat___134435542064 version = 8.0.3.4
Loaded module C:\Program Files\Siemens\NX 8.0\UGII\libsmdint.dll 7fed02b0000 1e2000 60c886c6-4a9f5f38-4f3030a2-3bf4a935-1=libsmdint___134437389864 version = 8.0.3.4
Loaded module C:\Program Files\Siemens\NX 8.0\UGII\libmodlint.dll 7fed8c00000 405000 5d705a58-4efb405c-b3f1b592-2e67ced7-1=libmodlint___134437650664 version = 8.0.3.4
Loaded module C:\Program Files\Siemens\NX 8.0\UGII\libhelpint.dll 7fed04a0000 124000 20b20dc1-47eef2f7-17103bb6-b74e380a-1=libhelpint___134437694464 version = 8.0.3.4
Loaded module C:\Program Files\Siemens\NX 8.0\UGII\libjadex.DLL 7fed31e0000 e8000 96c7f0e7-493de6a9-e6190ab-3a588a0b-1=libjadex___134435610164 version = 8.0.3.4

it doesn't create a dxf file now
Any other ideas?
 
 http://files.engineering.com/getfile.aspx?folder=fa526713-1ca9-4e72-bf2d-3006d509311e&file=can't_find.JPG
ok, thanks, did they give you any indication when that might be?
If it's months away i might re-install back to 8.0.2[hourglass]
 
I'm running NX 8.0.3.4 now. The dxf output journal seems to be working; a dxf file is produced and the log file indicates no errors. I am, however, having trouble importing the file back into NX to verify it. The dxf export log indicates thousands of lines/arcs created, but the import log only reports a couple of views and layouts were imported (no geometry). The translator appears to run, but I end up with an empty file.

Still looking into it...

www.nxjournaling.com
 
Cowski,
I just wondered if you'd managed to fix this journal yet, I've just tested the one off your journalising web site, but i get the error, where it say's it can't find the file (which is the displayed part)
I've just tried the custom one you did for me, and now it actually outputs the dxf, but (in a single sheet drawing), it duplicated the sheet 4 times, in the actual UG part, making it a 5 sheet drawing,and outputs 5 dxf files, when i view the dxf files, there is nothing in them

P.S I'm using 8.0.3.4
 
 http://files.engineering.com/getfile.aspx?folder=9113e1f9-624b-4af3-9f5f-0f9d9bc32c27&file=error.JPG
Due to my current workload, I've not been able to devote a block of time to track this one down. I have run various tests but so far the results are inconclusive. I've double checked the dxf output with the free edrawings viewer; this shows that there is geometry in the dxf output file. However, when I try to import it to NX, no geometry shows up. The layer list shows zero objects even when the dxf import wizard shows the correct preview. I'm starting to think it may be an internal NX import issue, though I'm not confident enough about that yet to take it to GTAC.

www.nxjournaling.com
 
ok, i'll keep my fingers crossed, Thanks.
 
I think that I've found the problem, there seems to have been a change with the NXOpen cgm importer in NX8. In NX8 when you use the menus to interactively import a cgm file, the geometry is placed in the current work view; but when NXOpen imports the cgm, a new drawing sheet is created and the geometry is placed on the sheet. Now when you export a dxf, this geometry is not getting exported. As far as I can tell, this is a change from NX7.5 and below.

To see the difference for yourself, do the following:

[ol 1]
[li]Open a drawing, export cgm file of the drawing.[/li]
[li]Create a new file.[/li]
[li]Start journal recording, import the cgm file.[/li]
[li]Stop journal recording, note geometry is in model view.[/li]
[li]Delete geometry.[/li]
[li]Replay the recorded journal.[/li]
[li]Note drawing sheet was created and cgm geometry is on new drawing sheet.[/li]
[/ol]

I've opened an IR with GTAC (6848806); I'm waiting to hear back whether that change was intentional or not...

www.nxjournaling.com
 
aahHHAaa...that's interesting, yes, same thing happens here..... thanks for the update
 
GTAC gave me a workaround while they look into the issue; there was an ER to the NXOpen function that looks like had some unintended consequences with the .NET function. The good news is, it looks like the workaround takes care of the problem.

I've updated my journal, the latest version can be found here:
or you can get it from

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor