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: JhoelForshav

I was able to get what I needed from the code you helped with. I have a similar situation where I need to have the user select 4 points on a door, Upper and Lower, Left and Right Vertices but this time it's in an assembly I tried my hand at code once more but I've hit a stumbling block with the Object problem again.  Here is the code I have so Far. This Time it's in ilogic. If there is a way of doing this without having to add the workpoints that would be great. Basically I just need to dimension from the YZ Plane to the bottom right and left points and from the top right and left points of the door to retrieve their dimension in the X axis so I can plug those numbers into a parameter that sets the length from midpoint in each direction of a secondary part. Any Help would be appreciated.

Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition

oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Please Select the Front Lower Left Vertex of the Door")
Dim wp1 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
wp1.Name = "wpt1"
oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Please Select the Front Lower Right Vertex of the Door")
Dim wp2 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
wp2.Name = "wpt1"
oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Please Select the Upper Left Vertex of the Door")
Dim wp3 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
wp3.Name = "wpt1"
oPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Please Select the Upper Right Vertex of the Door")
Dim wp4 As WorkPoint = oAsmDef.WorkPoints.AddByPoint(oPoint)
wp4.Name = "wpt1"

LowerTrainLeftDim = Measure.MinimumDistance("wpt1", "YZ Plane")
LowerTrainRightDim = Measure.MinimumDistance("wpt2", "YZ Plane")
UpperTrainLeftDim = Measure.MinimumDistance("wpt3", "YZ Plane")
UpperTrainRightDim = Measure.MinimumDistance("wpt4", "YZ Plane")