l3ob
Aerospace
- Apr 28, 2004
- 56
I am trying to improve a VBA utility so that the program will filter out all of the points, regardless of their typename, out of an openbody that is selected by the user. An example of this would be selecting an openbody of points and vectors that represent a fastener pattern. The points can be made my the point, intersect, or project function. I only want to work with the points within the openbody; so, I've tried to use 'FilterCorrespondence' with a 'Point' or type string identifier, to filter out the points from the selection. I get a 'not a valid VB function for this even though it shows up in the options list after the 'Selection.'. I've tried serveral things to reliably segregate points with no luck.
Code snippet:
If TypeName(SelectedPoints) = "HybridBody" And Selection3D.Count = 1 Then
Set SelectedPointsDoc = CatDocs.Item(Selection3D.FindObject("CATIAPart").Parent.Name)
PointCount = SelectedPoints.HybridShapes.Count
Selection3D.Clear
For j = 1 To PointCount
Selection3D.Add (SelectedPoints.HybridShapes.Item(j))
Next
ReDim SelType(0) As Variant
SelType(0) = "Point"
Filter1 = Selection3D.FilterCorrespondence(SelType)<<<Dies Here
Code snippet:
If TypeName(SelectedPoints) = "HybridBody" And Selection3D.Count = 1 Then
Set SelectedPointsDoc = CatDocs.Item(Selection3D.FindObject("CATIAPart").Parent.Name)
PointCount = SelectedPoints.HybridShapes.Count
Selection3D.Clear
For j = 1 To PointCount
Selection3D.Add (SelectedPoints.HybridShapes.Item(j))
Next
ReDim SelType(0) As Variant
SelType(0) = "Point"
Filter1 = Selection3D.FilterCorrespondence(SelType)<<<Dies Here