Code Vba
Code Vba
Renseigne sur différent objets de base mais pas d'extraction des données de blocs
ça fait un moment que je m'en sert, c'est un peu brut comme résultat mais ça permet
ensuite une grande souplesse sur excel (tri...)
Sub MOP()
Dim i As Long
With xlApp.ActiveSheet
.Cells(2, 1) = "N°"
.Cells(2, 2) = "Layer"
.Cells(2, 3) = "color"
.Cells(2, 4) = "Handle"
.Cells(2, 5) = "ObjectName"
.Cells(2, 6) = "x0"
.Cells(2, 7) = "y0"
.Cells(2, 8) = "z0"
.Cells(2, 9) = "Length/Volume"
PNum = 3
sLay = oObj.Layer
.Cells(PNum, 1) = PNum
.Cells(PNum, 2) = oObj.Layer
.Cells(PNum, 3) = oObj.color
.Cells(PNum, 5) = oObj.ObjectName
.Cells(PNum, 6) = oObj.Coordinate(0)(0)
.Cells(PNum, 7) = oObj.Coordinate(0)(1)
.Cells(PNum, 8) = oObj.Coordinate(0)(2)
.Cells(PNum, 9) = oObj.Length
End If
pBase = oObj.StartPoint
.Cells(PNum, 6) = pBase(0)
.Cells(PNum, 7) = pBase(1)
.Cells(PNum, 8) = pBase(2)
.Cells(PNum, 9) = oObj.Length
End If
pBase = oObj.Center
.Cells(PNum, 6) = pBase(0)
.Cells(PNum, 7) = pBase(1)
.Cells(PNum, 8) = pBase(2)
.Cells(PNum, 9) = oObj.Circumference
End If
pBase = oObj.Center
.Cells(PNum, 6) = pBase(0)
.Cells(PNum, 7) = pBase(1)
.Cells(PNum, 8) = pBase(2)
.Cells(PNum, 9) = oObj.ArcLength
End If
pBase = oObj.Position
.Cells(PNum, 6) = pBase(0)
.Cells(PNum, 7) = pBase(1)
.Cells(PNum, 8) = pBase(2)
.Cells(PNum, 9) = oObj.Volume
End If
pBase = oObj.Position
.Cells(PNum, 9) = oObj.Perimeter
.Cells(PNum, 10) = oObj.Area
End If
pBase = oObj.InsertionPoint
.Cells(PNum, 6) = pBase(0)
.Cells(PNum, 7) = pBase(1)
.Cells(PNum, 8) = pBase(2)
.Cells(PNum, 9) = oObj.EffectiveName
End If
PNum = PNum + 1
End If
Next oObj
End With
Exit Sub
fin:
End Sub