Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to suppress items in a rectangular pattern?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
oransen
691 Views, 4 Replies

How to suppress items in a rectangular pattern?

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

4 REPLIES 4
Message 2 of 5
Vladimir.Ananyev
in reply to: oransen

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

Message 3 of 5
oransen
in reply to: Vladimir.Ananyev

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.

 

 

Message 4 of 5
adam.nagy
in reply to: oransen

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
in reply to: adam.nagy

It does help, very informative on all counts. Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report