1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| Sub ze(ByVal centreX As Single, ByVal centrey As Single, ByVal longueur As Single, ByVal largeur As Single, ByVal angle As Single, ByVal pointx1 As String, ByVal pointy1 As String, ByVal pointx2 As String, ByVal pointy2 As String)
ActiveSheet.Shapes.AddShape(msoShapeRectangle, centreX, centrey, longueur, largeur).Select
Selection.ShapeRange.IncrementRotation angle
Selection.ShapeRange.Fill.Visible = msoFalse
Cells(2, 31) = ActiveWindow.Selection.ShapeRange(1).Name
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 0, 0, 0, 0).Select
Selection.ShapeRange.ConnectorFormat.BeginConnect ActiveSheet.Shapes(Cells(2, 31)), 1
Selection.ShapeRange.ConnectorFormat.EndConnect ActiveSheet.Shapes(Cells(2, 31)), 3
Cells(3, 29) = Selection.ShapeRange.ConnectorFormat.BeginX 'cette ligne ne marche pas
Cells(3, 30) = Selection.ShapeRange.ConnectorFormat.BeginY 'cette ligne ne marche pas
Cells(3, 31) = Selection.ShapeRange.ConnectorFormat.EndX 'cette ligne ne marche pas
Cells(3, 32) = Selection.ShapeRange.ConnectorFormat.EndY 'cette ligne ne marche pas
'Cells(2, 29) = (pointx1 + pointx2) / 2
'Cells(2, 30) = (pointy1 + pointy2) / 2
End Sub
Sub trace_ze()
Dim centreX As Single
Dim centrey As Single
Dim longueur As Single
Dim largeur As Single
'For i = 2 To 47
longueur = Cells(2, 26)
largeur = Cells(2, 27)
centreX = Cells(2, 24)
centrey = Cells(2, 25)
angle = Cells(2, 28)
pointx1 = Cells(2, 32)
pointy1 = Cells(2, 33)
pointx2 = Cells(2, 34)
pointy2 = Cells(2, 35)
ze centreX, centrey, longueur, largeur, angle, pointx1, pointy1, pointx2, pointy2
'Next i
End Sub |
Partager