How to suppress items in a rectangular pattern?

How to suppress items in a rectangular pattern?

oransen
Collaborator Collaborator
863 Views
4 Replies
Message 1 of 5

How to suppress items in a rectangular pattern?

oransen
Collaborator
Collaborator

If I have a RectangularPattern how do I suppress individual features in the pattern.

 

For example I have a single row of holes, and I want to suppress the odd numbered holes.

 

I've tried this...

 

        CComPtr<FeaturePatternElements> pFeaturePatternElements ;
        pRectPatFeat->get_PatternElements (&pFeaturePatternElements) ;

        const int ikNumElements = pFeaturePatternElements->GetCount() ;
        wprintf (L"   this has %d FeaturePatternElements\n",ikNumElements) ;

        for (int iElem = 1 ; iElem < ikNumElements ; iElem++) {
            CComPtr<FeaturePatternElement> pFeaturePatternElement ;
            pFeaturePatternElements->get_Item (iElem,&pFeaturePatternElement) ;

            // CRASH here....
            pFeaturePatternElement->Suppressed = (((iElem/2)*2) == iElem) ;
        }

 

... but it crashes at the assignment of Suppressed

0 Likes
Accepted solutions (1)
864 Views
4 Replies
Replies (4)
Message 2 of 5

Vladimir.Ananyev
Alumni
Alumni

Hope this post could give you some idea:

http://modthemachine.typepad.com/my_weblog/2013/03/control-feature-creation-based-on-user-defined-bo...

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

oransen
Collaborator
Collaborator

Thanks for the link, but it seems to have been a C++/COM problem.

 

If I use put_Suppressed() it works and does not crash.

 

If I used Suppressed =  (as in my original post) it does.

 

Hey ho hum.

 

 

0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

I've just written a blog post about this: http://adndevblog.typepad.com/manufacturing/2013/08/crash-when-not-using-raw-com-interface-to-set-pr...

 

I hope this helps.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 5 of 5

oransen
Collaborator
Collaborator
It does help, very informative on all counts. Thanks!
0 Likes