Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
neodd70
in reply to: neodd70

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