Hi!
I have problem in looping. SelPnt is arrays of circle's (xyz) points. while I am extracting circle point it will give array points. After the loop it will set Null. can anyone have solution.
so, I can not sorting without SelPnt array. because after looping it will set Null. where I am wrong. pls. give me little help. And also anyone can set select object by selectbypolygon with filter circle.
Thanks in Advance,Code:For Each oEnt In objSSet oPoly = oEnt i = (UBound(oPoly.Coordinates) + 1) \ 2 - 1 For j = 0 To i vexPt = oPoly.Coordinate(j) ReDim Preserve vxsArr(j) vxsArr(j) = vexPt Next outArr = ConvTo3dPoints(FlattenArray(RemoveDupVexs(vxsArr)), oPoly.Elevation) ReDim ptArr(0 To UBound(outArr)) 'As Double For i = 0 To UBound(outArr) ptArr(i) = CDbl(outArr(i)) Next Dim Ent As AcadEntity Dim oCirc As AcadCircle Dim gpCode(0) As Object Dim dataValue(0) As Object gpCode(0) = 0 : dataValue(0) = "CIRCLE" dxfcode = gpCode : dxfdata = dataValue setName = "$CircleSelect$" 'With acadDoc setColl = acadDoc.SelectionSets For Each objSSet In setColl If objSSet.Name = setName Then acadDoc.SelectionSets.Item(setName).Delete() Exit For End If Next objSSet = acadDoc.SelectionSets.Add(setName) 'End With 'objSSet.SelectByPolygon(AcSelect.acSelectionSetWindowPolygon, ptArr, (dxfcode.start. "CIRCLE") objSSet.SelectByPolygon(AcSelect.acSelectionSetWindowPolygon, ptArr) 'selMod = acSelectionSetWindowPolygon 'objSSet.SelectByPolygon(selMod, ptArr, dxfcode, dxfdata) objSSet.Highlight(False) ' debug only: 'MsgBox "Selected: " & CStr(objSSet.Count) & " objects" iCnt = objSSet.Count Dim eCnt As Integer Dim cPnt() As Double TextBox2.Text = objSSet.Count Dim SelPnt(,) As Double Dim SortPnt1(,) As Double ReDim SelPnt(0 To (iCnt - 1), 0 To 2) ReDim SortPnt1(0 To (iCnt - 1), 0 To 2) eCnt = 0 For Each Ent In objSSet oCirc = Ent If eCnt = 0 Then dblRad = oCirc.Radius cPnt = oCirc.Center SelPnt(eCnt, 0) = cPnt(0) SelPnt(eCnt, 1) = cPnt(1) SelPnt(eCnt, 2) = cPnt(2) Debug.Print("Selpnt 0 get = " & SelPnt(eCnt, 0)) Debug.Print("Selpnt 1 get = " & SelPnt(eCnt, 1)) Debug.Print("Selpnt 2 get = " & SelPnt(eCnt, 2)) eCnt = eCnt + 1 aup = 1 Next Ent SortPnt1 = SelPnt Next
Avinash


Reply With Quote