iLogic - Pattern occurrence w/out features

iLogic - Pattern occurrence w/out features

Anonymous
Not applicable
718 Views
2 Replies
Message 1 of 3

iLogic - Pattern occurrence w/out features

Anonymous
Not applicable

Hello

 

I want to pattern all parts but i don't want to take component feature (see picture below)

 

Capture.JPG

the number at the end of each part can be change.

 

i have this part of code, but it give an error message if i have pattern element.

 

oOccurrence = oAsmCompDef.Occurrences.Item(1)
oParentOccs.Clear
For Each oOccurrence In oAsmCompDef.Occurrences
    oParentOccs.Add(oOccurrence)
Next
  
oRectOccPattern = oAsmCompDef.OccurrencePatterns.AddRectangularPattern _
(oParentOccs, oYAxis, True, 2*oRowSpacing*2.54, oRowCount/2+0.5)

tanks for your help.

 

 

0 Likes
Accepted solutions (1)
719 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I had an idea,

 

if I suppress the component pattern, it is possoble to pattern all parts without take the suppressed parts.

 

I had try it and i take this error:

 

Error in rule: Dimension de la barge, in document: Test iLogic assemblage caisson BOC.iam

Paramètre incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

 

 

System.ArgumentException: Paramètre incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)

at Inventor.OccurrencePatterns.AddRectangularPattern(ObjectCollection ParentComponents, Object ColumnEntity, Boolean ColumnEntityNaturalDirection, Object ColumnOffset, Object ColumnCount, Object RowEntity, Boolean RowEntityNaturalDirection, Object RowOffset, Object RowCount)

at LmiRuleScript.Main()

at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)

at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

 

Thanks

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Ok, i found imself the solution,

 

here my part of code:

 

oParentOccs.Clear
For Each oOccurrenceNotPattern In oAsmCompDef.Occurrences
If Component.IsActive( oOccurrenceNotPattern.Name) Then
    
'For Each oOccurrence In oAsmCompDef.Occurrences
If Not TypeOf oOccurrenceNotPattern.Definition Is VirtualComponentDefinition Then
	oParentOccs.Add(oOccurrenceNotPattern)

End If
End If
Next

oRectOccPattern = oAsmCompDef.OccurrencePatterns.AddRectangularPattern _
(oParentOccs, oYAxis, True, 2*oRowSpacing*2.54, oRowCount/2-0.5)
0 Likes