Make element of a component pattern containing a component pattern Independent missing

CattabianiI
Collaborator
Collaborator

Make element of a component pattern containing a component pattern Independent missing

CattabianiI
Collaborator
Collaborator

Element of a component pattern containing a component pattern cannot be made Independent.
Check the image below:

CattabianiI_0-1665476225328.png

How can I achieve that? (no iLogic)

 

0 Likes
Reply
Accepted solutions (2)
1,052 Views
12 Replies
Replies (12)

sundars
Autodesk
Autodesk

Hi @CattabianiI 

 

Thank you for reporting this. This has been like that since the inception of component pattern of patterns back from 2009. I personally don't see why it shouldnt work. In fact I removed the logic which blocks the cmd and it worked fine for me. I need to dig into some history and see if there were any technical limitations which prevent this from working properly.

 

This is what you want....

sundars_0-1665526377638.png

 

Thanks

-shiva

Shiva Sundaram
Inventor Development

CattabianiI
Collaborator
Collaborator

Hi @sundars,

thank you for your answer! (very dev-oriented and I loved it.)

Yes that is want I want. 


The main purpose of my question is to know what Autodesk thinks is correct, because the indipendent thing is still doable via iLogic. And I use that API in my command, so what I want to know is whether someday that property will throw an exception because the API behaviour has been fixed accordingly with the UI one.

I'm, personally, ok at them moment with thr API - while I'm rather suprised no one has raised the UI issue so far - but please let me know when you have more information on the issue.

sundars
Autodesk
Autodesk

Thank you @CattabianiI . I greatly appreciate your comments 🙂

 

You are correct. The API/iLogic does not seem to have this limitation and you are free to make the elements of a comp pattern of a pattern independent.

 

Typically the UI comes first and added the right checks but when the API was implemented, it did not add that extra check to block comp patterns from being made elements. The story is that some things may not work properly wrt to downstream editing of that pattern once its made independent.

 

I played around the component pattern AFTER it was made independent.....and I find that the editing of this pattern to add new elements is a little confusing. The preview shows the parent pattern elements being changed 

 

For example

1. Edit that independent comp. pattern

2. Change the number of elements from 2 -> 4

3. The preview shows the parent pattern also changing from 2 -> 4

    (Here I would have expected the independent instance ONLY to show the new elements in preview)

4. Hit OK

5. Parent pattern also shows the edits 

    (Here I would have expected the independent instance ONLY to show the new elements)

 

I am still verifying whether this behavior is acceptable or not. My guess is that this is exactly the kind of behavior the original author wanted to avoid.

 

I have attached some images showing the behavior I described above. I have also attached a sample VBA - you can perhaps create a simple dataset and run that VBA. That simply runs through the comp. patterns and makes the elements independent. Then you will be able to try some UI edits and study the behavior and see if it makes sense.

 

Thanks

-shiva

 

Shiva Sundaram
Inventor Development

sundars
Autodesk
Autodesk
Accepted solution

Hi @CattabianiI 

 

I have created a story for us to investigate - please refer to INVGEN-64774. Thank you so much for reporting this.

 

-shiva

Shiva Sundaram
Inventor Development

Yijiang.Cai
Autodesk
Autodesk
Accepted solution

@sundars @CattabianiI Many thanks for you providing the feedback here, and this is also requested in the idea https://forums.autodesk.com/t5/inventor-ideas/make-elements-in-a-pattern-nested-within-another-patte...

You can also vote it.

We will also review the story for further investigation.

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com

CattabianiI
Collaborator
Collaborator

Hi @sundars,


The story is that some things may not work properly wrt to downstream editing of that pattern once its made independent.

Yeah, it doesn't seems to work very smoothly after making element indipendent.
Here's a video of Inventor crashing after making an element indipendent (via iLogic) and deleting (via delete key) the parent pattern in a recursive way.


Here's the report ID: 331983148

The workaround is to do the make elements independent + occpattern delete backwards (the depth doesn't matter, the breadth does!)

sundars
Autodesk
Autodesk

@CattabianiI Thanks for the info. I have updated the story with the crash error report information. That's good to have :). 

 

Shiva Sundaram
Inventor Development

maxim.teleguz
Advocate
Advocate

@CattabianiI wrote:

Hi @sundars,


The story is that some things may not work properly wrt to downstream editing of that pattern once its made independent.

Yeah, it doesn't seems to work very smoothly after making element indipendent.
Here's a video of Inventor crashing after making an element indipendent (via iLogic) and deleting (via delete key) the parent pattern in a recursive way.


Here's the report ID: 331983148

The workaround is to do the make elements independent + occpattern delete backwards (the depth doesn't matter, the breadth does!)


i did exactly that with this code:

'Sub Main()
    
'    Dim selectedPattern As String
'    'selectedIndex = InputBox(patternNamesList, "Select Pattern")
'    selectedPattern = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrencePatternFilter, "Select component")
	

'        If Not selectedPattern Is Nothing Then
'            For Each oElement In oCompPatternElements
'                If count > 0 Then
'                    oElement.Independent = True
'                End If
'                count = count + 1
'            Next
'        Else
'            MsgBox("Pattern not found.", vbExclamation)
'        End If

'End Sub

Sub Main()
    ' Set reference to active document.
    Dim oDoc As Inventor.AssemblyDocument
    oDoc = ThisApplication.ActiveDocument
    
    ' Get assembly component definition
    Dim oCompDef As Inventor.ComponentDefinition
    oCompDef = oDoc.ComponentDefinition
    
    Dim oPatterns As OccurrencePatterns
    oPatterns = oCompDef.OccurrencePatterns
    
    ' Prompt the user to select a component occurrence pattern
    Dim selectedObject As Object
    On Error Resume Next
    selectedObject = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrencePatternFilter, "Select a component occurrence pattern")
    On Error GoTo 0
    
    ' Check if a selection was made
    If selectedObject Is Nothing Then
        MsgBox("No occurrence pattern selected or operation canceled.", vbExclamation)
        Exit Sub
    End If
    
    ' Determine if the selected object is an OccurrencePattern
    Dim selectedPattern As OccurrencePattern
    If TypeOf selectedObject Is OccurrencePattern Then
        selectedPattern = CType(selectedObject, OccurrencePattern)
        'MsgBox("Selected Pattern: " & selectedPattern.Name)
    Else
        MsgBox("Selected object is not a valid occurrence pattern.", vbExclamation)
        Exit Sub
    End If
    
    ' Process the pattern elements
    Dim oCompPatternElements As OccurrencePatternElements
    oCompPatternElements = selectedPattern.OccurrencePatternElements

    Dim count As Integer
    count = 0
    
    For Each oElement In oCompPatternElements
        If count > 0 Then
            oElement.Independent = True
        End If
        count = count + 1
    Next
    
    'MsgBox("Pattern processed successfully.", vbInformation)
    

    selectedPattern.Delete()

End Sub



sundars
Autodesk
Autodesk

Hi @maxim.teleguz 

 

Thank you for reporting this issue. We will investigate and get back to you. I presume its reproducible with a simple testcase and doesn't need your dataset.

 

Thanks

-shiva

Shiva Sundaram
Inventor Development

sundars
Autodesk
Autodesk

Hi @maxim.teleguz 

 

Can you also send us the dataset so we can reproduce the exact same issue please? You can email it to me at

sundarsATautodeskDOTcom

 

Thank you

-shiva

 

Shiva Sundaram
Inventor Development

MjDeck
Autodesk
Autodesk

Hi @maxim.teleguz , I was able to reproduce the crash. I created an assembly that contains a pattern of a pattern of a pattern. Then I ran your rule several times: first on the top level pattern and then on the newly independent sub-patterns.
So I don't think we need a dataset, but if you want to share one please go ahead. We can use it to double-check.
This is internal issue INVGEN-80617.

As a workaround, you could make copies of the component occurrences (not the patterns). Then delete the patterns. This would require code to get the position of the each occurrence and apply it to the copy. If you need to preserve constraints it would probably require a lot of code.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes

maxim.teleguz
Advocate
Advocate

@MjDeck wrote:

Hi @maxim.teleguz , I was able to reproduce the crash. I created an assembly that contains a pattern of a pattern of a pattern. Then I ran your rule several times: first on the top level pattern and then on the newly independent sub-patterns.
So I don't think we need a dataset, but if you want to share one please go ahead. We can use it to double-check.
This is internal issue INVGEN-80617.

As a workaround, you could make copies of the component occurrences (not the patterns). Then delete the patterns. This would require code to get the position of the each occurrence and apply it to the copy. If you need to preserve constraints it would probably require a lot of code.


At least you now have something that every inventor user is currently wondering why there isnt a feature to "break pattern" in the right click menu. If you guys could do that that would be amazing. Just ground the components in place after breaking the pattern link. done. 

0 Likes