CAD software discussion forum > CAD > VBA: Points, PointEntity and coords

VBA: Points, PointEntity and coords

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 1 of 4

11-11-2009 11:46 . pm | View his/her posts only
Hi everyone,
About VBA usage in zwcad:
How can I get the coordinates from a point contained in a SelectionSet?
It seems I can get the point only using a PointEntity, but this way I can't reach its xyz coords.


Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 2 of 4

13-11-2009 05:52 . am | View his/her posts only
Hello, try this routine:

Private Sub get_xyzpoints()
Dim i As Long
Dim xyz As ZwCAD.ZwcadPoint
Dim ss As ZwcadSelectionSet
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
FilterType(0) = 0
FilterData(0) = "Point"
Set ss = ZwCAD.ActiveDocument.SelectionSets.Add("SS2")
ZwCAD.ActiveDocument.Utility.Prompt "Select the points: "
ss.SelectOnScreen FilterType, FilterData
Set xyz = New ZwcadPoint
For i = 0 To ss.Count - 1
xyz.x = ss(i).Coordinates(0).x
xyz.y = ss(i).Coordinates(0).y
xyz.z = ss(i).Coordinates(0).z
Next i
End Sub

Rank: 1

OldForumPost

Newbie

posts: 0

Registered: 2012-1-14

Message 3 of 4

01-12-2009 07:11 . pm | View his/her posts only
thx!

Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 4 of 4

07-12-2009 11:36 . am | View his/her posts only
You are welcome!
See also