Set definition on rectangular pattern not implemented?

Set definition on rectangular pattern not implemented?

casper.vorm
Contributor Contributor
351 Views
4 Replies
Message 1 of 5

Set definition on rectangular pattern not implemented?

casper.vorm
Contributor
Contributor

Hi.

 

I have a part where a pattern determines the placement and type of an inlet. I am trying to change the solid that is getting patterned by updating the definition, like so:

 

Dim new_def As RectangularPatternFeatureDefinition = oPartComp.Features.RectangularPatternFeatures.CreateDefinition(oBjCol, plane, True, count, offset/10, PatternSpacingTypeEnum.kDefault)
Dim rec_pattern As RectangularPatternFeature = oPartComp.Features.RectangularPatternFeatures.Item(pattern_name)
rec_pattern.Definition = new_def

 

But then I get an not implemented (0x80004001 (E_NOTIMPL))) exception. Instead, I have tried to find the pattern by name, delete it and then create a new one with the new definition, but it does not work every time.

Is there another way to update the definition, besides creating a new pattern?

 

Thanks in advance!

-Casper

0 Likes
352 Views
4 Replies
Replies (4)
Message 2 of 5

dgreatice
Collaborator
Collaborator

Check this:

https://www.youtube.com/watch?v=lI4GzJrJoj0

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 3 of 5

A.Acheson
Mentor
Mentor

As far as  I am aware you need to recreate the pattern from scratch as there is no ability to modify the object collection once pattern is created.

 

You are saying your getting some results can you explain more about what they are? Some images wouod help and or show more of the error message using more info. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 5

casper.vorm
Contributor
Contributor

Hi again.

@dgreatice Thank you, I will take a look at that video later.

@A.Acheson Yes I can try. 

I'm not sure how much of the model I'm allowed to share, but essentially, I have multiple rectangular patterns that determines the location and type of specific inlets:

pattern.png

As per the documentation, RegtangularPatternFeature.Definition Gets or Sets the definition of a pattern object, meaning I should be able to update an existing pattern right? I need this to update what solid is patterned at each inlet location.

However, when i try this i get:

error.png

As a workaround, I have tried to iterate through the patterns, delete them and create a new ones with the same name but a different definition, to update the inlet type. sometimes this works, but other times I get an null reference exception. I have attached the code.

 

 

0 Likes
Message 5 of 5

casper.vorm
Contributor
Contributor

So it seems I have solved one of the problems. When I deleted a pattern and later created a new one with the same name it sometimes gave an error. By accessing the definition object, i could update the solids that were getting patterned to different ones. 

However, when I try to set the spacing:

Dim rec_pattern As RectangularPatternFeature = oPartComp.Features.RectangularPatternFeatures.Item(pattern_name)
rec_pattern.Definition.XSpacing = offset

 I also get a "Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))" exception.

Is there anywhere I can report this? I couldn't really find a specific forum for it.

 

Best regards, Casper

0 Likes