Dim Obj1 As Object Dim BaSelect As Variant Dim Pt1 As Variant Dim Entite(0) As Object Dim RegionSel As Variant Dim Resultat As Double Dim Cpt1, I As Integer Dim ssetobj As AcadSelectionSet 'If ssetobj with the name mentioned above already exists - delete it For Each ssetobj In ActiveDocument.SelectionSets If ssetobj.Name = "1" Then ssetobj.Delete Exit For End If Next ssetobj 'aAd new ssetobj Set ssetobj = ActiveDocument.SelectionSets.Add("1") Call ssetobj.SelectOnScreen 'Si aucun Objet sélectionné If ssetobj.count = 0 Then MsgBox "You have not selected any object.", , "Error" ssetobj.Delete Exit Sub End If Dim AcadObj As Variant Dim StartPoint As Variant Dim EndPoint As Variant For Each AcadObj In ssetobj Select Case AcadObj.ObjectName Case "AcDbLine" StartPoint = AcadObj.StartPoint EndPoint = AcadObj.EndPoint MsgBox StartPoint(0) & " " & StartPoint(1) End Select Next AcadObj
For i = 0 To Cpt1 - 1 if ssetobj.Item(i).entityname l_objet_qui_va_bien then Set tblsel(i) ssetobj.Item(i) MsgBox tblsel(i).EndPoint(0) Next
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim StartPoint As Variant Dim EndPoint As Variant For Each AcadObj In ssetobj Select Case AcadObj.ObjectName Case "AcDbLine" StartPoint = AcadObj.StartPoint EndPoint = AcadObj.EndPoint MsgBox StartPoint & " " & EndPoint End Select Next AcadObj
AcadObj.StartPoint : : Variant/Double(0 to 2) : AcadObj.StartPoint(0) : 1194.13739858333 : Double : ... AcadObj.StartPoint(1) : 1087.71978604706 : Double : ... AcadObj.StartPoint(2) : 0 : Double : ...