Showing results for 
Search instead for 
Do you mean 

Projected Area value retrieve

Hello everyone.

I am trying to calculate the area of a face projection over a plane.

I am using the "CalculateAreaBuilder" and it works fine but it just prints out the Area value on the ListingWindow.


I have tried to reroute the data on a text file by doing a 

theSession.ListingWindow.SelectDevice(NXOpen.ListingWindow.DeviceType.File, "c:\\TEMP\\NXOPENTemp.txt");

right before the





It does not work.


Any hint is very very very welcome!






Any hint is very very welcome


Re: Projected Area value retrieve

See the online help for ListingWindow:




When the device is set to file, the buffer is not flushed until the device is changed again


Changes where the listing window output is sent. The listing window output can be sent to the Information window of the Unigraphics session, to a file, or to both. Note: file output is buffered. If file output is used, the buffer will not be flushed until the output device is changed again. E.g. 
        ListingWindow.SelectDevice(File, "log.txt")
        ' buffer is not flushed yet
        ListingWindow.SelectDevice(Window, "")
        ' now the buffer is flushed

Re: Projected Area value retrieve

Hello Jim,

thank you so much for your prompt answer.

The line


theSession.ListingWindow.SelectDevice(NXOpen.ListingWindow.DeviceType.Window, "");


if correctly flushing a text line to the external file but I still cannot get the result of the


nXObject1 = calculateAreaBuilder1.Commit();


written out to the file...


Am I doing something wrong?


Thanks again.



Re: Projected Area value retrieve

If you do not try to change devices to the file, does the information from the Commit get written as expected to the listing window?


Re: Projected Area value retrieve

Yes it Does: no matter if I specify the line


the commit writes to the listing window while the string goes to the external file.


Hereafter the chunk of code (I still hope I can get the projected area in some manner)



//specify the output file



//commit the face projected area calculation 
NXObject nXObject1;
nXObject1 = calculateAreaBuilder1.Commit();


//write a text message (this goes to the external file as expected!!)
theSession.ListingWindow.WriteLine("try try try");


//Flush following Jim's suggestion
theSession.ListingWindow.SelectDevice(NXOpen.ListingWindow.DeviceType.Window, "");



Thanks again for  your help!



Re: Projected Area value retrieve

The only thing I can think of is to switch the listingWindow device before instantiating the calculateAreaBuilder1 object rather than just prior to calling Commit().

Re: Projected Area value retrieve

As an alternative, I'd try extruding an zero thickness sheet body from the projected curves; then use the "measure face" tool to get the area, perimeter, etc. The sheet body could then be deleted after getting the required information.

Re: Projected Area value retrieve

Just tried: no way. Commit just deals with the NX popup listingwindow...

Re: Projected Area value retrieve

Cowski, thanks to you too. At this point I think I shoudl try something like that... I have been trying to avoid this kind of complication but I do not see anything else I can do with the mold stuff.





Re: Projected Area value retrieve

Did you try to switch the device to text file before creating the builder, as Jim proposed ?