NX9 JOURNAL FOR MOVING OBJECTS TO LAYERS
NX9 JOURNAL FOR MOVING OBJECTS TO LAYERS
(OP)
Objective = VB code for moving all Curves, Dimensions, Notes, Labels,Symbols and Groups to layer 254 (done in drafting)
Reason = File Checker insists on specific objects to be on specific layers. Too often a detailer will take a new detail and just start detailing it up, and not until they are done will they realize they forgot to set the work layer to 253 or 254 which is supposed to hold all of the drafting objects. So everything is on layer 1 (or whatever layer they had set as their work layer). If they window around everything and move to layer 254, it can also select solid bodies, sheet bodies etc... inside the views. So I would like to create a button that when selected it will automatically do a Move to Layer, and use the filters to select everything (Not in the views) to layer 254.
Note:
If I record a journal to do this and select by filters, I dont see where it shows it is selecting specific objects by filter settings. It seems to record each individual object being selected instead.
Reason = File Checker insists on specific objects to be on specific layers. Too often a detailer will take a new detail and just start detailing it up, and not until they are done will they realize they forgot to set the work layer to 253 or 254 which is supposed to hold all of the drafting objects. So everything is on layer 1 (or whatever layer they had set as their work layer). If they window around everything and move to layer 254, it can also select solid bodies, sheet bodies etc... inside the views. So I would like to create a button that when selected it will automatically do a Move to Layer, and use the filters to select everything (Not in the views) to layer 254.
Note:
If I record a journal to do this and select by filters, I dont see where it shows it is selecting specific objects by filter settings. It seems to record each individual object being selected instead.





RE: NX9 JOURNAL FOR MOVING OBJECTS TO LAYERS
If I can learn how to get just a couple different objects through the filter and select all, like Curves and Points, I am pretty sure I can fix it to find other objects like Dimensions, Notes, Labels and symbols.
I dont understand why there is so much that recording a Journal will not record. This makes it really hard for people who are amateurs to VB code to learn. Sorry if I sound frustrated. It is just that I had an easier time recording and manipulating macros than I have with VB.
RE: NX9 JOURNAL FOR MOVING OBJECTS TO LAYERS
www.nxjournaling.com
RE: NX9 JOURNAL FOR MOVING OBJECTS TO LAYERS
There is a fairly well-known set of techniques for removing selection code from journals. The best description of it is in the "Getting Started with SNAP" document. Search for "FindObject".
Using SNAP functions, what you want is easy. It's basically just something like
CODE --> VB.NET
For Each obj As Snap.NX.NXObject in workPart.Objects If object is a suitable type obj.Layer = 254 End EndUsing NX/Open functions will be somewhat clunkier, but not too bad.