Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
5769 Views, 5 Replies

iLogic Pick function to select faces in a part file

Hello,

 

In a part file, I am trying to control and switch the color of certain faces through a view representation.  I made a manual process for this and now trying to create a rule in iLogic to automate this procedure.  See pdf for the step-by-step. 

 

Anyway, I believe I need the pick(k...filter) function in order for this work but I cannot figure how to write the function to select faces on a part file.  I have only seen this command be applied in assembly files for part instances.  I managed to put this together so far.  Can someone explain how to use this function to select multi faces and change the color of those faces in a part file?

 

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oPartDef As PartComponentDefinition
oPartDef = oPartDoc.ComponentDefinition
Dim oFeature As PartFeature
   For Each oFeature In oPartDoc.ComponentDefinition.Features
  Feature.Color(oFeature.Name)="As Part"
 Next


'Step 2 : part i cannot figure out.  It will be something like:

' This.Application.CommandManager.Pick ( k...Filter, "Select the face")  

 

oPartDef.RepresentationsManager.DesignViewRepresentations.Add("Red Surfaces")

Dim oColor As RenderStyle
oColor = oPartDoc.RenderStyles.Item("4-Red")
oPartDoc.ActiveRenderStyle = oColor

 

Regards,

Anthony