Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

I run this code, but got some error

Status
Not open for further replies.

godpaul

Automotive
Joined
May 4, 2014
Messages
119
Location
US
nx 8.5 + office 2013 pro 32bit


as you mentioned ms access 32bit cannot talk to NX 8.5, so i want to try excel and i found a post where you posted some code to write excel file using journal:


after i run the code, the following error occurs:
server busy
the action cannot be completed because the other program is busy. choose "Switch" to activate the busy program and connect the problem........

what happen??

also, in that post, you said that:
you can access Excel as per the following code, but you lose the 'autocomplete' feature of visual studio. If you go this route, you may want to keep an instance of Excel running so you can reference the object model.

how do you keep an instance of Excel running?

thank you
 
The original code was tested on NX 7.5 (64 bit) and Excel 2010 (32 bit). I tested this morning and it also runs on NX 8.5 (64 bit) and Excel 2010 (32 bit). I'd guess the message you see has something to do with Excel 2013, but I cannot test that...

I should have been more clear with my "keep an instace of Excel running" comment. By that I simply meant that you may want to keep Excel open while programming your journal. This way you can record a macro in Excel and quickly see what objects, properties, and methods you can use to accomplish the task. Also, the Excel code may be interspersed with Excel constants such as Direction.xlUp; most of these are enumerations in Excel. Using the Excel object browser (easy to get to if you have Excel open), you can find the numerical value of the constant and enter it in your journal code for the same effect.

www.nxjournaling.com
 
thank you cowski,

since i am now trying to use to loop through notes on drawing. and you know that notes are scattered everywhere on drawin.

what will be the best way to identify note so that they can match with "something" in Excel and then if matched, the content of note can be updated.

when i do the tolerance looping through task, i use AppendedTest to identify each dimension, but now looks like note is headache....
 
i think i found the solution

i write something like this

For Each note As Note In displayPart.Notes

by writting:
note.tostring

it will return the ID of the note like this: Note 98483
 
Try comparing
note.ToString
to
note.Tag.ToString

If the numbers returned are the same, then the .ToString method is returning the tag number of the note. The Tag property is NOT guaranteed to remain the same from session to session (i.e. the tag number you see today may not be the same tag number you see when you close and reopen the part).

www.nxjournaling.com
 
YOU are correct, neight of them will retain the same value each time i close and re-open the drawing file.....

is there any other alternative solution?
 
yes, found a way

right click on notes, property, then in the General tab, give a name in the Name textbox.

in the code write something like

if note.getname() = "fsdfsade"

then...
 
The usual method is to assign a custom attribute or (as you have already found) a custom name to the object of interest.

www.nxjournaling.com
 
this method was pointed by John Baker when I asked how to suppress feature

so, what's the benefit for using attribute? will there be a dramatic code change?

I saw lots of method and property under note such as note.getattributeType, AttributeInformation, etc, etc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top