Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Could anyone help with changing this code that contains all items to the XY plane and change it to work plane 1
@Curtis_Waguespack
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oPlane As WorkPlane
Dim oProxyPlane As WorkPlaneProxy
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef)
'check for and skip virtual components
'(in case a virtual component trips things up)
If Not TypeOf oOccurrence.Definition Is VirtualComponentDefinition Then
oPlane = oOccurrence.Definition.WorkPlanes.Item(3) 'Work Plane4
'create component proxy plane in assembly
Call oOccurrence.CreateGeometryProxy(oPlane, oProxyPlane)
End If
'get assembly plane
Dim oPlane2 As WorkPlane
oPlane2 = oAsmCompDef.WorkPlanes.Item(3) 'Work Plane4
' Create the constraint using the work plane proxies.
Call oAsmCompDef.Constraints.AddFlushConstraint(oProxyPlane, oPlane2, 0)
Next
Thank you
Solved! Go to Solution.