Here is my code. The only thing that does not seem to work is the last line (not the End Sub). Any help would be grateful. Thanks,
Mike
Sub DrawingTest()
Dim InvDwgDoc As DrawingDocument
Set InvDwgDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = InvDwgDoc.ActiveSheet
Event1:
Dim oDrawingView As DrawingView
Set oDrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "PICK A DRAWING VIEW")
Event2:
Dim oPartLine As DrawingCurveSegment
Set oPartLine = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "PICK A LINE ON YOUR PART")
Dim oPartLineParent As DrawingCurve
Set oPartLineParent = oPartLine.Parent
Dim oModelGeo As Object
Set oModelGeo = oPartLineParent.ModelGeometry
Dim oParent As Object
Set oParent = oModelGeo.Parent.Parent
Dim oRDD As PartDocument
Set oRDD = oParent.ReferencedDocumentDescriptor.ReferencedDocument
Dim oWP As WorkPoint
Set oWP = oRDD.ComponentDefinition.WorkPoints.Item(1)
oSheet.Centermarks.AddByWorkFeature oWP, oDrawingView
End Sub