Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have a question that I have not been able to solve. I have two pieces inside an assembly. I would like with an Ilogic rule, from the assembly to select a workpoint from the part (Adaptative), define it as adaptive, and then redefine it with a vertex of the geometry of another part (Base). I need to solve this simple task and then apply it to a more complex problem, where several points of arbitrary orientation define the main geometries of my assembly.
I tried to make a code, which did not work for me.
Sub Main() Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oPart As ComponentOccurrence 'Pick part occurrence oPart = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Seleccione Pieza") If oPart Is Nothing Then Exit Sub Else oPart.Adaptive = True Dim oDef As PartComponentDefinition oDef = oPart.Definition Dim MidA As WorkPoint = oDef.WorkPoints.Item("Med1") MidA.Adaptive = True overt = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartVertexFilter, "Seleccione Vertice") MidA.SetByPoint(overt) End If End Sub
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
Solved! Go to Solution.