Selection search to array
Selection search to array
(OP)
Hi:
Im trying to asign the elements of a selection search to an array in order to automatically find the edges of a solid and generate points. More specifically, the code for search selection is this:
Sub CATMain()
Dim objSel As Selection
Set objSel = CATIA.ActiveDocument.Selection
objSel.Search ("Type=Edge,all")
objcount = objSel.Count
MsgBox objcount
End Sub
What I need is to asign every element of the search to an array in order to extract the centers of some circles. Does anyone know how to acomplish such weird task?
Thank you in advance!
Im trying to asign the elements of a selection search to an array in order to automatically find the edges of a solid and generate points. More specifically, the code for search selection is this:
Sub CATMain()
Dim objSel As Selection
Set objSel = CATIA.ActiveDocument.Selection
objSel.Search ("Type=Edge,all")
objcount = objSel.Count
MsgBox objcount
End Sub
What I need is to asign every element of the search to an array in order to extract the centers of some circles. Does anyone know how to acomplish such weird task?
Thank you in advance!





RE: Selection search to array
I suggest you to check Mike Berry's blog, there is a post called "Easily display array values in a Msgbox for debugging" maybe will help you more (generally speaking, that blog is a golden mine for not professional programmers like us).
Of course you can get what you want with something like this.
For i = 1 To objcount
MsgBox objSel.Item(i).Name
Next
To extract the center of circles, depends on the type of the circle object (are they edges of something or sketches or ....).
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Selection search to array
Dim objSel As Selection
Set objSel = CATIA.ActiveDocument.Selection
objSel.Search ("Type=Edge,all")
objcount = objSel.Count
Is there any way to avoid the wireframe recognition? I attached an image for better explain myself.
RE: Selection search to array
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Selection search to array
RE: Selection search to array
if you want to be very accurate, you can check the name of the element and find reference to the solid before you get the center point.
indocti discant et ament meminisse periti
RE: Selection search to array
Place points in a tube macro.