rookiezzz
Structural
- Jul 27, 2022
- 25
Dear all
This community is so great for rookie like me.
Have anyone ever tried to find the nearest face and edge from a body against a specific point?
I am looping through faces and edges and then measure the distance against point to find the nearest one, but it takes too much time.
is that possible to project the point to body and idenify the projection result belongs to which face?
Here is my current code.
Set oSel = oDoc.Selection
oSel.add(body1)
oSel.Search "Topology.face,sel"
x =20000
for i = 1 to oSel.count
Set referenceSurface = oSel.item(i).value
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench("SPAWorkbench")
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(referencepoint)
MinimumDistance = TheMeasurable.GetMinimumDistance(referencesurface)
if MinimumDistance < x then
x = MinimumDistance
Set referencesurfaceclosest = oSel.item(i).value
end if
next
This community is so great for rookie like me.
Have anyone ever tried to find the nearest face and edge from a body against a specific point?
I am looping through faces and edges and then measure the distance against point to find the nearest one, but it takes too much time.
is that possible to project the point to body and idenify the projection result belongs to which face?
Here is my current code.
Set oSel = oDoc.Selection
oSel.add(body1)
oSel.Search "Topology.face,sel"
x =20000
for i = 1 to oSel.count
Set referenceSurface = oSel.item(i).value
Set TheSPAWorkbench = CATIA.ActiveDocument.GetWorkbench("SPAWorkbench")
Set TheMeasurable = TheSPAWorkbench.GetMeasurable(referencepoint)
MinimumDistance = TheMeasurable.GetMinimumDistance(referencesurface)
if MinimumDistance < x then
x = MinimumDistance
Set referencesurfaceclosest = oSel.item(i).value
end if
next