The information contained in AutoCAD Points (X, Y, Z Coordinates) are the Building Blocks of Digital Terrain Model. i.e Details stored in AutoCAD points can be used to build DTMs.
Following video is about, How to create a Macro for Extracting details from AutoCAD Points
Topics Discussed are
1. Extracting X, Y & Z Coordinates of Point
2. Extracting layer name of each AutoCAD Point
5. AcadObject & AcadPoint
Following video is about, How to create a Macro for Extracting details from AutoCAD Points
Topics Discussed are
1. Extracting X, Y & Z Coordinates of Point
2. Extracting layer name of each AutoCAD Point
5. AcadObject & AcadPoint
Code for Extracting Details of AutoCAD Points
Sub ExtractDetailsOfAutoCADPoints()
Open "E:\Tutorials on AutoCAD\ExtractDetailsOfAutoCADPoints\ExtractedDetails.txt" For Output As 1
Dim x, y, z As Double
Dim XLnCADObject As AcadObject
Dim XLnCADPoint As AcadPoint
For Each XLnCADObject In ThisDrawing.ModelSpace
If XLnCADObject.ObjectName = "AcDbPoint" Then
Set XLnCADPoint = XLnCADObject
x = XLnCADPoint.Coordinates(0)
y = XLnCADPoint.Coordinates(1)
z = XLnCADPoint.Coordinates(2)
Print #1, x; y; z; " " & XLnCADPoint.Layer
End If
Next
Close (1)
Dim retval As Variant
retval = Shell("Notepad.exe " & "E:\Tutorials on AutoCAD\ExtractDetailsOfAutoCADPoints\ExtractedDetails.txt", vbNormalFocus)
End Sub
Question: when I run the code it's giving me an empty text file beside that I didn't recognize the word "AcDbPoint"
ReplyDelete1. Check the File Path
Delete2. AcDBPoint is the Object Name for AcadPoint