Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

NX8.0 VB run - slow response

Status
Not open for further replies.

spadazenon

Mechanical
Mar 28, 2010
49
Hi all,

Although I have a long time experience with NX, I cannot find what is wrong when opening a large assembly and running a script.

I run a custom script in vb to handle attributes. The script reads some attributes of the work part and I have a windows interface to change them as I like and do

When I open a part of a subassembly (only 27 parts of that subassembly loaded in memory) and run the script is super fast (it takes about 1~2 secs). But when I open the same part inside a greater assembly (~1800 parts loaded in memory) that contains the previous mentioned subassembly and run the script (doing the exact same things, not interacting with other parts of the assembly) it takes for ever. Sometimes up to 5 minutes.

My point is that as long as I have open a part as work, it shouldn't take that long because the only thing that the script does is to change the attributes.

On the information bar it says "updating objects" all time. I had no issue with NX7.5 on this. The computer is quite powerful.

I have tried to enter manually the attributes to see if there is the problem. Apart from the new interface that handles the attributes, I have noticed that you cannot enter an attribute with more than 30 characters. Say what? Why? OK, but why don't I have the same problem If I have only few parts loaded in memory.

Thank you in advance.

Stathis
 
Replies continue below

Recommended for you

Well, it sounds like you are not changing the attributes just for the work part, but for all parts in the assembly... or am I making a wrong assumption? Also, what attributes are you changing? Component attributes or actually part attributes? Can you provide some code?

Marc
NX Software Developer
 
Thanks Mark for your reply.

Unfortunately this is not the case. I tried to change the attributes manually and had the same time delay.

To give you more details: I start by opening the component inside an assembly , that I want to change attributes, as a work part. So, I change the actual part attributes in order to use them later when I do the draftings. The program reads the part attributes if any and writes them temporarly to txt files and then a windows basic form app opens and reads them again (I use VB 10 Express, and cannot make run from inside UG so I call it through the vb script and do the transaction through read and write). When finished editing the attributes the vb script reads them again and updates the part. Not very sophisticated but it does what I need.

Here the whole vb script. The windows form it is just an interface to change the text files.


 
Hi,

I just took a look at your code. I believe part of the problem is how you designed your program. Writing the value of one attribute in one temporary file is a potential performance killer. Why not write all the attributes you need in one file? E.g. <title> = <value>, one per line.

(I use VB 10 Express, and cannot make run from inside UG so I call it through the vb script and do the transaction through read and write).

Does this mean you cannot create a DLL with VB 10 Express? Or do you not have a NXOpen / UGOPEN license?

Marc
NX Software Developer
 
Hi Marc,

I could do write all the attributes that I need in a file. But nevertheless, I don't think that it would make much of a difference given the fact that I tried to manually (from inside NX) to change only one attribute and did take long time to change it. So, I think that the most of the problem comes with the way that NX8 handles now the attributes. I didn't have any delays with NX7.5 (whatever size the assembly had).

When I first noticed the great delay, I did some tests. I was killing the process of the script in several time intervals, in order to see in which line had it progressed. All times the line was where it wrote the attribute to the part. I tried as I told you before to change them manually and had the same delay. So, I think that the problem is at the way/process of NX writing the attributes to the part.

I know that NX did some changes to the attributes so, I downloaded from ftp/ugs the documentation, but regarding the NXOPEN section it is the same as for NX7.5, nothing new added yet.
We have 2 licences ugopen_menuscript but none for styler. To tell you the truth, I am not a programming expert. I use only the basics to do enhance my job.

Thanx,

Spada
 
What about load options and part complexity? In NX7.5 I have come to realize that just setting a complex part (multiple bodies, large amounts of blends, ...) as the work part can take several seconds, during which "Updating objects..." is displayed.

Marc
NX Software Developer
 
Hi Mark,

Sorry, what do you mean by load options? Why load options would affect a script to a part inside an assembly that it has opened as work part and because of that, fully.

The problem is not during making the part as work but after it is work part, applying the attributes that I want. And as you have seen inside my program isn't something special.

Thanks,

Spada
 
Even if I enable the delay to all interpart updates it takes for ever to write the attributes to the part.

I keep seeing the updating objects while I am waiting the whole process to complete. Do you know what exactly gets updated if someone writes an attribute to a work part and hits apply. If I knew what exactly was updating maybe I could figure out how to handle it better.

Thanks,

Spada
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor