ZWSOFT User Community > ZWSOFT Forums - Find. Share. Connect. > ZWCAD > VBA: Points, PointEntity and coords
VBA: Points, PointEntity and coords

Rank: 1

zw_admin

Newbie

posts: 0

Registered: 2012-1-14

Message 1 of 4

VBA: Points, PointEntity and coords
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.


TOP 0 Kudos

Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 2 of 4

VBA: Points, PointEntity and coords
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
TOP 0 Kudos

Rank: 1

zw_admin

Newbie

posts: 0

Registered: 2012-1-14

Message 3 of 4

VBA: Points, PointEntity and coords
01-12-2009 07:11 . pm | View his/her posts only
thx!
TOP 0 Kudos

Rank: 1

disedig

Newbie

posts: 0

Registered: 2011-11-30

Message 4 of 4

VBA: Points, PointEntity and coords
07-12-2009 11:36 . am | View his/her posts only
You are welcome!
TOP 0 Kudos
© 2012 ZWCAD Software Co., Ltd. All rights reserved. | About ZWSOFT | Privacy Policy | Terms and Conditions | Contact us | Site Map
All trademarks,trade names or company names referenced herein are used for identification only and are the property of their respective owners.