erezzo
Computer
- Apr 23, 2004
- 1
hi everyone, i'm trying to find the intersection point of two lines and then to create new lines using the intersection point (to break the line into two lines)...
my problem is when there isn't any intersection point- so the function "intersectWith" return unknown value. i need to check if there is a valid value or not but i don't know how... i tried the following code but the "if" statement don't give me the option that i need:
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET") ssetObj.SelectOnScreen
Dim newLine1 As AcadLine
Dim intPoint As Variant
intPoint = ssetObj.Item(0).IntersectWith
(ssetObj.Item(1), acExtendNone)
If VarType(intPoint) <> vbEmpty Then
Set newLine = ssetObj.Item(0)
Set AcadLine = ThisDrawing.ModelSpace.AddLine
(intPoint, newLine.EndPoint)
newLine.EndPoint = intPoint
End If
Next index2
Next index1
please help me - i can't find any other way........
my problem is when there isn't any intersection point- so the function "intersectWith" return unknown value. i need to check if there is a valid value or not but i don't know how... i tried the following code but the "if" statement don't give me the option that i need:
Dim ssetObj As AcadSelectionSet
Set ssetObj = ThisDrawing.SelectionSets.Add("TEST_SSET") ssetObj.SelectOnScreen
Dim newLine1 As AcadLine
Dim intPoint As Variant
intPoint = ssetObj.Item(0).IntersectWith
(ssetObj.Item(1), acExtendNone)
If VarType(intPoint) <> vbEmpty Then
Set newLine = ssetObj.Item(0)
Set AcadLine = ThisDrawing.ModelSpace.AddLine
(intPoint, newLine.EndPoint)
newLine.EndPoint = intPoint
End If
Next index2
Next index1
please help me - i can't find any other way........