Sorry, I am totally new to VBA.?
I have added your second code to the first code.
The unit is converted to mm, its a success.
but the center point and line endpoints are still there.
'ILOGIC CODE
AddReference "Microsoft.Office.Interop.Excel" 'To use excel
Dim oExcelApp As Microsoft.Office.Interop.Excel.Application
oExcelApp = CreateObject("Excel.Application")
oExcelApp.Visible = True
Dim wb As Microsoft.Office.Interop.Excel.WorkBook
xlwb = oExcelApp.Workbooks.Add
Dim xlws As Microsoft.Office.Interop.Excel.Worksheet
xlws = xlwb.Worksheets(1)
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oPartCompDef As PartComponentDefinition
oPartCompDef = oPartDoc.ComponentDefinition
'Get the first sketch in the model
Dim oSketch As Sketch
oSketch = oPartCompDef.Sketches.Item(1)
Dim oSketchPoint As SketchPoint
Dim x As Integer
x = 1
xlws.Cells(x, 1).Value = "x"
xlws.Cells(x, 2).Value = "y"
x = 2
For Each oSketchPoint In oSketch.SketchPoints
If oSketchPoint.AttachedEntities.Count = 0 Then '2nd code
End If
'Values in cm
xlws.Cells(x, 1).Value = oSketchPoint.Geometry.x * 10 '2nd code
xlws.Cells(x, 2).Value = oSketchPoint.Geometry.Y * 10 '2nd code
x = x + 1
Next
The reason I am trying to solve this is that I could not solve my other problem. if it's ok please take a look at this too, thanks.
https://forums.autodesk.com/t5/inventor-customization/creation-sketch-with-vba-ilogic/m-p/8998899#M1...