routine to extract object that meet certain criteria

routine to extract object that meet certain criteria

Anonymous
Not applicable
277 Views
5 Replies
Message 1 of 6

routine to extract object that meet certain criteria

Anonymous
Not applicable
i am in need of a routine that will search my selection for circle radius = 21.3 and will put the coordinates of those circles in a text file or an excel file...any ideas?
0 Likes
278 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Well, here's how to get the object data you want: Sub circ_rad() Dim ss As AcadSelectionSet Dim dxfCode(1) As Integer Dim dxfVal(1) As Variant Dim ent As AcadEntity Dim circ As AcadCircle Dim cen Set ss = ThisDrawing.PickfirstSelectionSet dxfCode(0) = 0: dxfVal(0) = "CIRCLE" dxfCode(1) = 40: dxfVal(1) = 21.3 ss.Select acSelectionSetAll, , , dxfCode, dxfVal For Each ent In ss Set circ = ent cen = circ.Center Debug.Print "Center X = " & cen(0); ", Center y = " & cen(1); ", Center Z = " & cen(2) Next End Sub -- Jeff check out www.cadvault.com "jbryant4" wrote in message news:3498544.1109271280093.JavaMail.jive@jiveforum2.autodesk.com... >i am in need of a routine that will search my selection for circle radius = >21.3 and will put the coordinates of those circles in a text file or an >excel file...any ideas?
0 Likes
Message 3 of 6

Anonymous
Not applicable
i copied the routine, opened up the VB editor, pasted the copied text and ran...where does the output go to?
0 Likes
Message 4 of 6

Anonymous
Not applicable
view|immediate (ctl + g) debug.print means print to immediate window "jbryant4" wrote in message news:29628325.1109273916443.JavaMail.jive@jiveforum1.autodesk.com... > i copied the routine, opened up the VB editor, pasted the copied text and ran...where does the output go to?
0 Likes
Message 5 of 6

Anonymous
Not applicable
so when i run the routine, i should see the info in the ACAD text box? I am new to all of this, so your patience is greatly appreciated
0 Likes
Message 6 of 6

Anonymous
Not applicable
No, in the VBAIDE press CTRL G to bring up the immediate window and it will be shown there. This was merely an example to show you how to get the data. To display it in acad, you could add this line below the Debug.Print..... line: circ.Highlight True MsgBox "Center X = " & cen(0) & ", Center y = " & cen(1) & ", Center Z = " & cen(2) circ.Highlight False You will need additional code, most of which can be found in the help files and example code, to export to a text or excel file. -- Jeff check out www.cadvault.com "jbryant4" wrote in message news:8031806.1109276932549.JavaMail.jive@jiveforum2.autodesk.com... > so when i run the routine, i should see the info in the ACAD text box? I > am new to all of this, so your patience is greatly appreciated
0 Likes