get the circeledgeID from Normparts in Assembly to connect/replace in VBA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
i have a VBA Macro witch replaces Normparts but i can not set Lockrotation and i can not define the CirceledgesID
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oCompOccs As ComponentOccurrences
Dim oCompOcc As ComponentOccurrence
For Each oCompOcc In oAsmCompDef.Occurrences
If oCompOcc.ReferencedDocumentDescriptor.FullDocumentName = "C:\Vault\Normteile\de-DE\DIN 934 - A2\DIN 934 - M8 - A2.ipt" Then
Call oCompOcc.Replace("C:\Vault\Normteile\de-DE\DIN 934 - 10 - verzinkt\DIN 934 - M4 - 10 - verzinkt.ipt", False)
End If
Next
i also found in the Forum a Sample from YuhanZhang (06-04-2019) for connecting Parts manually select the edges.
my question is it possible to get the CircleedgeID automatikally? like
Dim oEdge1 As Edge
Set oEdge1 = Insertconnected CircleedgeID the OLDNormpart(DINXXX.IPT) is connected to in the Assembly
Dim oEdge2 As Edge
then put a NEWNormpart (DINYYY.IPT)in the Assembly and insertConnect it Manually to an Circeledge.
Set oEdge2 = now get the insertConnect CircleedgeID of the NEWNormpart
and connect the CircledgeID the OLDNormpart is connected to with the CirceledgeID the NEWNormpart is conected
Dim oInsert As InsertConstraint Set oInsert = oAsmCompDef.Constraints.AddInsertConstraint(oEdge1, oEdge2, True, 0)
with Lockrotation is set
and delete the OLDNormpart
if this is posible i would be very happy if some one can give me an tipp where to look or even a snipped.
thanks a lot