Cancel
Showing results for 
Search instead for 
Did you mean: 

Change selected PMI orientation using Blockstyler

Experimenter
Experimenter

Hi, 

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.

 

Question 1: 

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?

 

Question 2:

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.

 

Thanks 

Dominik

 

 

2 REPLIES 2
Highlighted

Re: Change selected PMI orientation using Blockstyler

PLM World Member Legend PLM World Member Legend
PLM World Member Legend

Hi @Dominik79 

 

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)

Re: Change selected PMI orientation using Blockstyler

PLM World Member Legend PLM World Member Legend
PLM World Member Legend
Question 2:

Is it possible to manage all these different kind of PMI with ONE builder? No. You need to find the type of the PMI Object selected and initialize the builder with that object (PMIFeatureControlFrameBuilder, PMIDatumTargetBuilder..etc).

There are no direct logic or classes available to modify the orientation of the PMI. If you look at the class architecture of Annotations.Annotation, in which you could find the generic function of PMI irrespective of the type.

Hope this information helps.