kduck63 发表于 2022-7-6 22:39:09

Extract x,y,z point info

I made this little program in vba a while back to extract points and write an output file. I would like to start writing this stuff in vb express 2010, but i am not sure how to extract the x,y,z info from each point when in the .net world. I have searched the threads, but i don't see the answer.
 

Private Sub CommandButton1_Click()UserForm1.Hide   Dim sset As AcadSelectionSet         Dim OpenFlag As Boolean   Set sset = ThisDrawing.SelectionSets.Add("SS1")   sset.SelectOnScreen                     Dim ent As AcadObject                      Dim x As Double   Dim y As Double   Dim z As Double   Dim coords As Variant   EntCnt = 0   Open "c:\temp\point_xyz.csv" For Output As #1   For Each ent In sset      'Loop through the SelectionSet collection       If ent.ObjectName = "AcDbPoint" Then         coords = ent.Coordinates         x = coords(0)         y = coords(1)         z = coords(2)         Print #1, x, ",", y, ",", z       End If   Next ent   Close #1   sset.Delete   UserForm1.Show   EndEnd Sub

kduck63 发表于 2022-7-7 00:34:51

I just realized the express edition of vb 2010 has an Object Browser.... that should help me answer my question.
页: [1]
查看完整版本: Extract x,y,z point info