- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm completly lost with this proxy issue. I don't do much programming in this field. So far I have the attached assembly as an example (the code is building it all successfully so far). I want to connect the bottom of the plate on the bushing to the plate of the cover, then have it ask for the centerline of the hole it is to attach to. Then I need to resize the hole according to the iproperty in the plate. Can someone help me get this code fixed to attach the plate to the cover and then start a clsSelect event to choose the centerlines via mouse event? The code below gets the sub assembly component of the plate, and works all the way through the create geometry proxy, but after this, I can't get any examples I've found here to work. I think it's the sheet metal object in the main assembly. I do have a clsSelect / Pick standard function included in my Class Modules already.
Thanks in advance to anyone that can help. I'm stuck.
--------------------------------------
Public Sub MateConstraint()
' Get the top assembly document.
Dim oMainAsmDoc As AssemblyDocument
Set oMainAsmDoc = ThisApplication.ActiveDocument
' Get a reference to a subassembly in the top assembly. This case: the Plate below the bushing.
Dim oSourceSubAsmOcc As ComponentOccurrence
Set oSourceSubAsmOcc = oMainAsmDoc.ComponentDefinition.Occurrences.ItemByName("HVBushingAssy:1").Definition.Occurrences.ItemByName("BushingPlateHV:1")
' Get a reference to another instance of the top assembly.
Dim oTargetSubAsmOcc As ComponentOccurrence
Set oTargetSubAsmOcc = oMainAsmDoc.ComponentDefinition.Occurrences.ItemByName("TopCover3_8:1")
'Get the extrude feature of the bushing
Dim oExtrudeFeature As ExtrudeFeature
Set oExtrudeFeature = oSourceSubAsmOcc.Definition.Features.ExtrudeFeatures(1)
Dim oSubAssExtProx As ExtrudeFeatureProxy
Call oSourceSubAsmOcc.CreateGeometryProxy(oExtrudeFeature, oSubAssExtProx)
End Sub
Solved! Go to Solution.