Partial Delete via VBA

Hi,

The little hair I have left is turning grey in frustration.Persevere

I am running MicroStation V8i and try to automate some procedures.

I am trying to perform a partialdelete function on an arc, but the function returns "Nothing" in the return element. 

For testing I created an arc running through (5,5,0) just to make things easy

The routine is part of a much larger program that draws Coplex Chains from different elements, but this little bit is not working.

Anyone seeing something I can't see?

Sub PartDel()
Dim scancrit As ElementScanCriteria
Dim elemenum As ElementEnumerator
Dim point(2) As Point3d
Dim elm1 As Element
Dim elm2 As Element
Dim archelem As Element
Dim dist As Double

point(0).x = 0
point(0).Y = 0
point(0).Z = 0
Set scancrit = New ElementScanCriteria
scancrit.ExcludeNonGraphical
scancrit.IncludeType msdElementTypeArc
Set elemenum = ActiveModelReference.Scan(scancrit)
Do While elemenum.MoveNext
  Set archelem = elemenum.current
  point(1) = archelem.AsArcElement.StartPoint
  point(2).x = 5                                        ' this is a known point (variable)
  point(2).Y = 5                                        ' It shall be part of the parameters
  point(2).Z = 0                                        ' to this routine
  archelem.AsArcElement.PartialDelete elm1, elm2, point(1), point(2), point(0), 1    ' This return "Nothing" in elm1
  ActiveModelReference.AddElement elm1
Loop
End Sub

Parents Reply Children
No Data