GRIP & Creating a Layer List
GRIP & Creating a Layer List
(OP)
Does anyone know of a simple way to get NX (using GRIP) to export a layer list which contains a object count for each layer to a scratch file!
Thanks in Advance
Pondering...
Thanks in Advance
Pondering...





RE: GRIP & Creating a Layer List
Coming up with a grip to spit out a layer list isn't a challenge. However, some more info would be helpful so that we have a better idea as to why you need this information, what will be done with it, etc.
If your folks don't follow strict layering conventions and if standards aren't enforced, this info would have limited uses... but coming up with a routine that would spit out a total entity count for each layer, along with whatever layering category it belongs to, should be fairly easy.
SS
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: GRIP & Creating a Layer List
You have almost hit the nail on the head with standards, I have a large number of drawing part files created using a 'MODEL' reference set, prior to a change in our Teamcenter Workflows configuration, which automatically generates CGM's based upon the ENTIRE PART reference set, so creates rubbish 'automatically' if a drawing has been defined using the MODEL reference set.
I am using GRIP to generate a visible in View layering mask. The programme will (hopefully)
Get all of the view names with the database, strip out the '@' symbol from the views names and replace it with '-'.
These revised view names will then be used to define layer categories. (hence having to remove the special character from the name)
Once that is created. I want to remove the category name from any layers which don’t have geometry,
Then I can make visible in the views, by the category name.
I currently have all of this working.............Except............ getting a layer list which has object count on it.
I know it should be simple, but my brain has gone blank...
Any help / guidance are much appreciated.
Cheers,
Prondering
RE: GRIP & Creating a Layer List
Ahh... if I understand you correctly, you want to take an existing part file and:
1. create a visible in view layering mask for each saved view **So are we talking model or drawing views, or both?**
2. define layering categories based off the saved view name **are you deleting the existing layering categories or keeping them?**
3. cycle through the layers and if the entity count is zero, remove that layer from whatever layer category includes that layer
Does this sound about right?
I can see (read imagine in my mind's blind eye) several approaches to do this, but a better idea of how your code is structured would help (unless you wanted to make this a subroutine...).
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: GRIP & Creating a Layer List
1. Yes, I intend to have a different layer mask for each view in the drawing, not worried about the model layouts
2. Yes, I intend to create a category name based upon the view name, i.e. view FRONT@1 will be category FRONT-1 (the ‘@’ symbol is not valid in a category name)
3. I shall then push the layers currently visible in the view(s) into the relevant categories. I shall then delete the categories from any layers which contain no entities.
The basic structure I have thus far is:-
1. Scan the views & create layer categories based upon their name.
2. Delete categories from any layers which contain no geometry. (the Bit I cant get my head around at the moment)
3. Use ‘Visible in view’ to remove all of the geometry from the views.
4. Then, use ‘Visible in view’ again to display the layers defined by the relevant categories into the various views, i.e. layers in category FRONT-1 will be displayed in view FRONT@1 and so on.
Obviously the usual error checking (active part, etc……) is included.
It is my current intention to have a single programme and not use any subroutines as I only intend to use this programme myself (not for general user use as would encourage them to not follow the procedures)
I anticipate that most of the drawings should be able to be fixed doing this, leaving the odd few to be manually done, (They will all have to visually checked prior to being released anyway)
The whole process works manually, it’s just the layer ‘stripping’ bit I can’t seem to get to work.
Any help, advice or guidance is always appreciated.
Cheers in advance,
Pondering…………………..
RE: GRIP & Creating a Layer List
Just curious; how are you dealing with views containing a specific view mask or a non-standard view mask? How are you dealing with existing layering categories? Ignoring them?
Concerning #2 above: (1)don't look at it as deleting a category name from a layer... look at it as deleting a layer from a category (2)or as not assigning a layer to a category if the entity count<=0 (3) or even as having two separate grips: one to interrogate the part, assign an attribute, and write any existing data to file(s) and the other grip to check for the attribute to proceed, close and reopen the partfile so its in its virgin state, manipulate the partfile, and if successful then remove the attribute.
You kind of have me curious now...
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: GRIP & Creating a Layer List
I take your point about tackling the issue of categories and empty layers from another angle. Perhaps some brain fuel (beer) over the weekend will help.
Cheers,
Pondering……………
RE: GRIP & Creating a Layer List
On a serious *yeah right* note, how do the detailers mask out entities they don't want to show? in a detail part? in an assembly? Do they view-dependently erase what they don't want to see? ...edit the vis-n-view mask? ...blank objects? ...is everyone pretty consistant as to which method or could it be anything?
Regards,
SS
CAD should pay for itself, shouldn't it?
RE: GRIP & Creating a Layer List
John R. Baker, P.E.
Product "Evangelist"
NX Product Line
UGS Corp
Cypress, CA
Phone: 714-952-6032
FAX: 714-952-5758
John.R.Baker@ugs.com