Cancel
Showing results for 
Search instead for 
Did you mean: 

Export assembly to Excel with picture

Phenom
Phenom

Hi,

can someone change the code in the manner that the description attribute is substituied by my custom attribute 'DENOMINAZIONE' ?

 

Thank you...

Using NX 11 / RuleDesigner PDM

17 REPLIES

Re: Export assembly to Excel with picture

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

It appears that you have made the change to line 172:

objWorksheet.Cells(2, colDescription).Value = c.RootComponent.GetStringAttribute("DENOMINAZIONE")

 

Now make the same change to line 415:

xlsWorkSheet.Cells(intWriteRow, colDescription).Value = child.GetStringAttribute("DB_PART_NAME")

Re: Export assembly to Excel with picture

Phenom
Phenom
Hi,
I've done the modification you have suggested, but doesn't function.
I've another problem, when part in assembly are empty, like wires, oil, manual. In this case we create parts without geometry, but present in the part list.
This situation create error during crop the image :
Failed: System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at BomToExcel.CreateCroppedNxScreenshot() in c:\temp\NXJournals3548\journal.vb:line 623
at BomToExcel.reportComponentChildren(Component comp, Int32 indent, Object& xlsWorkSheet) in c:\temp\NXJournals3548\journal.vb:li
ne 441
at BomToExcel.reportComponentChildren(Component comp, Int32 indent, Object& xlsWorkSheet) in c:\temp\NXJournals3548\journal.vb:li
ne 447
at BomToExcel.reportComponentChildren(Component comp, Int32 indent, Object& xlsWorkSheet) in c:\temp\NXJournals3548\journal.vb:li
ne 447
at BomToExcel.Main() in c:\temp\NXJournals3548\journal.vb:line 188
Thank you...

Using NX 11 / RuleDesigner PDM

Re: Export assembly to Excel with picture

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

"I've done the modification you have suggested, but doesn't function."

 

"Doesn't function" is pretty vague. Do you get an error message? incorrect values? computer crashes?

 

If you are running the journal on native NX (not Teamcenter), then you will have to change lines 175 and 417 to return the desired attribute instead of the part file name.

 

 

Re: Export assembly to Excel with picture

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Did the change work for you?

Re: Export assembly to Excel with picture

Phenom
Phenom

Hi,

sorry for the delay, but we was closed.

I tested your suggestions, but I can't obtain the desired result.

Atteched the journal.

Another problem in the journal that interrupt is when the jpg exported from an empty part, the journal try to crop the jpg.

Thank you...

Using NX 11 / RuleDesigner PDM

Re: Export assembly to Excel with picture

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Are you using native NX or some sort of PLM system (such as Teamcenter)? This may affect where you need to get the "description" attribute from.

Highlighted

Re: Export assembly to Excel with picture

Phenom
Phenom
Native.
Thank you...

Using NX 11 / RuleDesigner PDM

Re: Export assembly to Excel with picture

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Try this version:

BomToExcel_cubalibre.vb

Re: Export assembly to Excel with picture

Phenom
Phenom

@cowski1 wrote:

Try this version:

BomToExcel_cubalibre.vb


Good works.

Remain the problem that the journal stop when the part is empty and the jpg is blank.

Thank you...

Using NX 11 / RuleDesigner PDM