insert an instance of a component and constrain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Guys,
I'm writing a bit of VBA to add another instance of an existing assembly component & constrain it.
The problem is that the edge of the original instance is being constrained and NOT the edge of the new instance.
Notice that I added a constraint to the original component (perhaps there's an easier method?).
Here's the code:
If oRad1 = oRad Then
' take a copy of part and insert
Dim oOccurence As ComponentOccurrence
Set oOccurence = oOccurences.Add(oPath, Omatrix)
Set oDoc2 = oOccurence.Definition.Document
Set oEdge = oDoc2.AttributeManager.FindObjects("iSert")
Set oInsert = AssmDoc.ComponentDefinition.Constraints.AddInsertConstraint(oEdge, oEdgeH, True, 0)
Set oEdge = Nothing
Set oDoc2 = Nothing
End If
Can anyone see what's wrong?
Many thanks in advance.
Dave
Envisage UK Ltd