I'm starting out with NXOpen and have some questions using VB code and the blockstyler.
I wanted to create a solution to let the user select serveral PMI in a view and change all of their orientations acc to a selected or created CSYS.
I managed to get all the "standard" PMI (linear dimensions/horizontal/vertical) selected via "select object block".
But somehow I can't select surface finish PMI. Any advice on this?
The next and larger problem is getting those selections oriented.
I had a look at a comparable journal and understood that I need to use those builder classes to modify their origin.
So far so good.
But after having a look at the Python API documentation i saw that there are a lot of different builder function.
And as I do not know which kind of PMI is selected (center mark; dimensions....) is it possible to manage all these different kind of PMI with ONE builder?
The only solution I found was using "brute force" with try and catch.
But I would need to run through all sorts of PMI and check for a match. I would imagine there is some more elegant solution to this?
Any help on this would be appreciated.
Question-1: Add the below code in your initialize callback to select the surface finish symbol along with all other type of PMI.
Dim mask(2) As Selection.MaskTriple mask(0).Type = UFConstants.UF_smart_model_instance_type mask(0).Subtype = 0 mask(0).SolidBodySubtype = 0 mask(1).Type = UFConstants.UF_drafting_entity_type mask(1).Subtype = 0 mask(1).SolidBodySubtype = 0 mask(2).Type = UFConstants.UF_dimension_type mask(2).Subtype = 0 mask(2).SolidBodySubtype = 0 selection0.GetProperties.SetSelectionFilter("SelectionFilter", Selection.SelectionAction.ClearAndEnableSpecific, mask)