Extracting Coords from Points

The VBA forum deals with IntelliCAD 2000 VBA (Visual Basic for Applications) issues.

Moderator: CMS Inc

Post Reply
Jalen
Newbie
Posts: 1
Joined: Tue Jan 12, 2016 2:59 pm

Extracting Coords from Points

Post by Jalen » Wed Jan 13, 2016 10:25 am

Background:

We get a dxf. with a series of points from a survey. I am looking to extract the coordinates from those points so I can sort them into groups for manipulation, but I cant seem to get the coordinates out if 'Point' or 'PointEntity'.

Code: Select all

Dim objENT As IntelliCAD.PointEntity
Dim ssetObj As SelectionSet
Set ssetObj = ActiveDocument.SelectionSets.Add("MySS54")
Dim xCoord() As Double
Dim yCoord() As Double
Dim zCoord() As Double

ssetObj.Select vicSelectionSetAll
count = ssetObj.count

ReDim xCoord(count) As Double
ReDim yCoord(count) As Double
ReDim zCoord(count) As Double

index = 0                                               'Extract Coordinates from existing Points
    For Each objENT In ssetObj
        If objENT.EntityName = "Point" Then
            xCoord(index) = objENT.Coordinates(0)
            yCoord(index) = objENT.Coordinates(1)
            zCoord(index) = objENT.Coordinates(2)
            index = index + 1
'            Debug.Print CSng(xCoord(index))
'            Debug.Print CSng(yCoord(index))
'            Debug.Print CSng(zCoord(index))
        End If
    Next objENT
Any help would be appreciated. Ive tried that same syntax with:

Code: Select all

objENT.x
I get the same result.

I'm using objENT as a PointEntity because using Point gives me issues with the selection set.

Thanks!!
Post Reply