Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

show reference sets journal

moog3

Marine/Ocean
Nov 29, 2022
66
I found a journal which shows all objects in the MODEL reference set, but it's not working properly.
I'm using NX2212.
Is there a problem with the code or am I doing something wrong?

when I run the journal in an assembly, on one of the components, I double click the component to make it the work part,
then run the journal and de-select something in the MODEL reference set, (the selection scope is set to "within work part only") then I ok the dialog.
(while I'm still in there), I check, with the reference set dialog, what's in the MODEL reference set, and its shows what I expected (the selection scope is set to "within work part and components").
Now I double click on the top level, to make it the work part and the component shows as before, without the change I just did.

Maybe the journal was created before NX expanded the scope of selectable objects, & the code needs a tweek.

the journal can be found here.
https://nxjournaling.com/content/show-reference-set-objects
 
Replies continue below

Recommended for you

sometimes I get this error, when I run the code, after taking all objects out of the reference set, its a bit random
1736464420021.png
Any help appreciated.
 
There's a Lightweight body that's generated automatically since some NX version later than 7.5 the script was developed in.

It's on the MODEL Refset, and I guess it interferes with the object selection part of the journal code.
 
Bleaker's got a good point; the lightweight component body representation was changed after this journal was written. I'm not sure if/how it affects the code. I'll have to look into this more as I get the time. In the mean time, I suggest using "show exact" on the component before making it the work part and running the code. I can't guarantee this will solve the issue, but if it does, it would point to the lightweight rep as the root cause.

Also note that a ref set can have the "add all components automatically" option turned on; if you attempt to remove a component from the ref set, NX may add it back automatically when you aren't looking. I think this option is on by default for the system controlled "MODEL" ref set.

The error message shown confuses me; it errors on a call to Regex.Replace, but the journal code does not make use of regex at all. The closest it gets is a string comparison on the ref set name. Did you incorporate this journal into your own code? If not, it must be part of the code that NX is executing internally.
 
i don't think the "show exact" does anything to help it.
I'm using the code as it is without any mods.
I do have the defaults set as you said, but that doesn't look like its affecting things

1736722817428.png

If you create a simple assembly you can test what I've found...
1. create a top level assy file.
2. create a component, put 2 blocks and 2 datum planes in there...
3.now, from the top level, double click the component to go work part,
4. using the code, add a datum to the MODEL ref set.
5. go up to the top, and check (its all good)
6. go work part on the component, and using the code, remove everything from the ref set.
7. go up to the top, and it will still show the bodies.
To get an error, try this..
8. go work part on the component, using the code hover over a body and wait for the dots, for selection scope.
9. select the "component" from the list, ok to get an error
1736725204907.jpeg
1736725247615.jpeg
My question is, Why do I even get the option to pick the component? (from inside the part)
This seems almost like the selection options I get from the top level on the displayed objects.
 
Last edited:

Part and Inventory Search

Sponsor