05-30-2018
08:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-30-2018
08:24 AM
So I realized that the object I was missing was to Dim my oPoint as a Vertex but now when I run my code I get an error that it just failed without any explanation of what failed. Would somebody be able to tell me what I am doing wrong here. I have searched the forums and the only thing I was able to find was setting a Fixed WorkPoint with typed in coordinates but nothing on picking a vertex of a part in an Assembly as where I want to place the WorkPoint. Here is the Code I have.
Sub Door_Corners() Dim oAsmDoc As AssemblyDocument Set oAsmDoc = ThisApplication.ActiveDocument Dim oAsmDef As AssemblyComponentDefinition Set oAsmDef = oAsmDoc.ComponentDefinition Dim oPoint As Vertex Set oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartVertexFilter, "Please Select the Front Lower Left Vertex of the Door") Dim wp1 As WorkPoint Set wp1 = oAsmDef.WorkPoints.AddByPoint(oPoint) End Sub