Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, at the begining I would like to say that I am beginer in iLogic.
I have written ilogic rules which changes color surfaces depends which value is in custom properties.
i added attribute name for surface which i want to change.
The trigger of rule is set after any change iProperties in part.
When I am in the part, the rule works well, but when I change the custom property from the assembly level, which triggers rules in the part, that rule doesn't work.
I suppose that issues with
ThisApplication.ActiveEditDocument
I get an error (unfortunately not english language):
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveEditDocument
Dim oCompDef As ComponentDefinition
oCompDef = oPartDoc.ComponentDefinition
Dim oFaces As Faces
Dim oFace As Face
Dim oSurfBodies As SurfaceBodies
Dim oSurfBody As SurfaceBody
Dim oStyle As RenderStyle
oStyle = oPartDoc.RenderStyles.Item("Green")
oSurfBodies = oCompDef.SurfaceBodies
oFaces = oSurfBodies.Item(1).Faces
For Each oSurfBody In oSurfBodies
oFaces = oSurfBody.Faces
For Each oFace In oFaces
For i = 1 To 2
Try
If oFace.AttributeSets.Item(i).Item(1).Value = "Long1" Then
If iProperties.Value("Custom", "Long1") = "1" Or iProperties.Value("Custom", "Long1") = "2" Then
Call oFace.SetRenderStyle(kOverrideRenderStyle, oStyle)
Else
Call oFace.SetRenderStyle(kPartRenderStyle)
End If
End If
If oFace.AttributeSets.Item(i).Item(1).Value = "Long2" Then
If iProperties.Value("Custom", "Long2") = "1" Or iProperties.Value("Custom", "Long2") = "2" Then
Call oFace.SetRenderStyle(kOverrideRenderStyle, oStyle)
Else
Call oFace.SetRenderStyle(kPartRenderStyle)
End If
End If
If oFace.AttributeSets.Item(i).Item(1).Value = "Short1" Then
If iProperties.Value("Custom", "Short1") = "1" Or iProperties.Value("Custom", "Short1") = "2" Then
Call oFace.SetRenderStyle(kOverrideRenderStyle, oStyle)
Else
Call oFace.SetRenderStyle(kPartRenderStyle)
End If
End If
If oFace.AttributeSets.Item(i).Item(1).Value = "Skort2" Then
If iProperties.Value("Custom", "Short2") = "1" Or iProperties.Value("Custom", "Short2") = "2" Then
Call oFace.SetRenderStyle(kOverrideRenderStyle, oStyle)
Else
Call oFace.SetRenderStyle(kPartRenderStyle)
End If
End If
Catch
End Try
Next
Next
Next
Solved! Go to Solution.