I try to get ahead with blockstylerprogramming.
Start ing the programm a face.collection is created, and should be used in the face selector as selected elements. #:
face_select0 = CType(theDialog.TopBlock.FindBlock("face_select0"), NXOpen.BlockStyler.FaceCollector)
How can I put the collection into the selected face ui block?
some help would be nice
I find it little difficult to understand your requirement but what I understood is you have a collection of faces in an variable(may be a list of faces) and you want to add this list to face selection block in your blockstyler dialog box so that when your dialogbax is displayed in NX it will show your face list as already selected, did I understood correct?
If yes, then you can do this as below
1. Get the property list of the face selection block, in your case of face_select0
2. Set the tagged objects of this property list with your available face collection objects.
Hope this helps.
yes you got me right, I want that collected .getfaces into the faceselect ( collector) ot the BS.
I'm looking for a code sipped for handling property list and tagged object it is not clear to me.
Unfortunatly I am not on my development system now to provide you the snippet immediately, but I will get the snippet for you soon, need to wait for few days.
thx on reply,
here I'm hanging:
Dim tags(-1) As NXOpen.Tag
tags = face.tagList.toarray
ma_att.face_select0.GetProperties.SetTaggedObject("whatever", tags )
I assume that you have a list of face tags.
Since I work in C#, below code lines are of C#, but you can find similar way in VB .net also.
You need to get the face objects from this tags, for that use for loop and process each tag to get its object as below
face_obj = (NXObject)NXOpen.Utilities.NXObjectManager.Get(face_tag);
then collect this objects in a list e.g. List<NXObjects> face_obj_list.
Once you have all face objects in the list pass this list to set tagged object vector of your block styler block. In you case it should be like
Try this, it should work. If you get some error let me know the error message.