Hello everyone,
This is my first post although using this page as source for solutions to many of my problems.
I have the following Problem and am currently looking for a way to solve it:
I have multiple DItems (Drawings) in NX opened and loaded concurrently.
Each has a various amount of Views.
Each View displays a certain amount of bodies, which should all have an attribute "x" with the same value.
I intend to check, whether the displayed bodies in each View have the correct value(the name of the view) and if the number of bodies in said View is correct. I use Check-Mate to get tags for all bodies available
mqc_askEntitiesInLayer(mqc_parseLayerStrings( { "1" }, "-"),SOLID_BODY,true);
This is forwarded to Visual Basic code and stored in a List(Of Body), resulting in all loaded parts bodies concatenated into one list.
I get all Views using following code:
PublicFunction GetAllPartsViews(ByVal parts As PartCollection)As List(Of View) GetAllPartsViews =New List(Of View) ForEach part As Part In parts Dim partViews As ViewCollection partViews = part.Views ForEach view As View In partViews GetAllPartsViews.Add(view)NextNextEndFunction
For the next step I need to know which bodies are displayed in which View. I found the function View.AskVisibleObjects()
, but this can only be used, if the View is the current WorkView. As there is no View.Bodies or Body.Views I struggle with finding a way to associate the two.