JasW Posted November 21, 2016 Report Share Posted November 21, 2016 Kolejny Bug w VBA ( vernum=11574) Nie mozna zmieniać ilości verteksów obiektów 3dPolyline ( ZCad3dPolyline ) Dwa powazne błedy - 3dPoly.AppendVertex = Point3 ' ERROR - Poly3d.Coordinates = ArrayOfPoints ' ERROR po A) MsgBox powinien podać 2 vertexy po B) MsgBox powinien podać 3 vertexy po C) MsgBox powinien podać 4 vertexy W Autocad działa wszystko ok. w ZWCAD 2017 tylko A) czyli tworzenie od zera ... Jesli nie będzie prostego obejścia ( moze lisp?) to błąd wg mnie brak poważny. Prosze o weryfikację i ew. zgłoszenie do ZWSOFT. Przykład do sprawdzenia niżej. Pozdrawiam J. Sub Test3dPoly() Dim polyObj As Zcad3DPolyline Dim pNew(0 To 2) As Double Dim Points1(0 To 5) As Double Dim Points2(0 To 11) As Double Dim p As Variant Dim RetCoord ReDim RetCoord(0 To 8) As Double Dim nvertices As Integer Points1(0) = 0: Points1(1) = 0: Points1(2) = 0 Points1(3) = 10: Points1(4) = 10: Points1(5) = 10 ' A) Create 3dPoly Set polyObj = ThisDrawing.ModelSpace.Add3DPoly(Points1) nvertices = (UBound(polyObj.Coordinates) + 1) / 3 ' for 3D polylines MsgBox "Poly after create vertices = " & nvertices ' B) New Vertex by call Poly.AppendVertex (pNew) pNew(0) = 40: pNew(1) = 30: pNew(2) = 40 polyObj.AppendVertex pNew ' ZWCAD Failed / ACAD Ok p = polyObj.Coordinate(2) ' Method 'Coordinate' of IZCad3dPolyline failed nvertices = (UBound(polyObj.Coordinates) + 1) / 3 ' ZWCAD Error / ACAD Ok MsgBox "Poly After AppendVertex Number of vertices = " & nvertices ' C) Set Size by Assign polyObj.Coordinates from Array of four Points Points2(0) = 0: Points2(1) = 0: Points2(2) = 0 Points2(3) = 0: Points2(4) = 0: Points2(5) = 0 Points2(6) = 0: Points2(7) = 0: Points2(8) = 0 Points2(9) = 0: Points2(10) = 0: Points2(11) = 0 polyObj.Coordinates = Points2 nvertices = (UBound(polyObj.Coordinates) + 1) / 3 ' ZWCAD Error (type mismatch) / ACAD Ok MsgBox "Poly After Assign Number of vertices = " & nvertices End Sub Link to comment Share on other sites More sharing options...
kruszynski Posted November 22, 2016 Report Share Posted November 22, 2016 Dziękuję za zgłoszenie przekazałem do ZWSOFT Link to comment Share on other sites More sharing options...
JasW Posted January 25, 2017 Author Report Share Posted January 25, 2017 Zwcad 2017 SP2 vernum13656 : Potwierdzam poprawność modyfikacji przez VBA API ilości wierzchołków 3dPolyline zarówno metodą B) jak i C) Pozdrawiam, J. dmatusz3 1 Link to comment Share on other sites More sharing options...
dmatusz3 Posted January 25, 2017 Report Share Posted January 25, 2017 Dziękuję za informację. Link to comment Share on other sites More sharing options...
Recommended Posts