Jump to content

Recommended Posts

Posted

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

   End
End Sub

Posted

I just realized the express edition of vb 2010 has an Object Browser.... that should help me answer my question.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...