Groups in 3D parts

Experimenter
Experimenter

I am trying to group some features together in a 3D part but cannot find the VB net or VB6 code for it. I've done it before for draft files but can't work it out for part files. Can anyone please help?

6 REPLIES

Re: Groups in 3D parts

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The following code groups all features into a single group:

    '----------------------------------------------------------------------
    ' PAR: Join all features into a single feature group
    '----------------------------------------------------------------------
    Dim objPart As PartDocument = objApp.ActiveDocument
    Dim objModel As Model = objPart.Models.Item(1)
    Dim objFeats As EdgebarFeatures = objPart.DesignEdgebarFeatures
    Dim featGroup As FeatureGroup = objModel.FeatureGroups.AddFeatureGroupsByRange(objFeats.Item(1), objFeats.Item(objFeats.Count))
    featGroup.Name = "All Features"

Re: Groups in 3D parts

Experimenter
Experimenter

Can anyone expand on this so if you have say 3 features in the 3D part how you would add 2 of them into a group rather than all of them?

Re: Groups in 3D parts

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Please check the SDK help.

There are two methods to group features, the one I was using in my previous post groups all features in a range, from the first given feature until the last given feature.

If you need to group a set of features, collect them in an array first and pass this array later to the AddFeatureGroupBySet method.

Re: Groups in 3D parts

Experimenter
Experimenter

There does not seem to be any help on this topic anywhere not even in SDK? I will try to ask Siemens using IR again...

Re: Groups in 3D parts

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

This functionality was added in V20 and is mentioned in the online help (http://support.industrysoftware.automation.siemens.com/training/se/107/api/webframe.html).

Look for AddFeatureGroups in the index (see attached image).

 

Re: Groups in 3D parts

Experimenter
Experimenter

Martin. Thanks for your help with this. I've now got it sorted.