I'm using the attached code to add meshpoints to a surface. For some reason, FEMAP is not able to capture the points. Am i missing something here. Appreciate any direction. Thank you.
As always with API objects, you need to "Put" the object after making modifications. Your code is all basically correct, you just need to add
s.Put( s.ID )
after your call to AddMeshPoint()
You're missing a Put() call on the surface object prior to meshing. That should clear everything up.
One word of caution though - I can't really tell the intent from your code, but hardpoints on a surface work best when they're in the middle of the surface. The closer you get to the edge of a surface, the greater the chances that you'll end up with a sliver surface, especially if you lay a hardpoint that lies on one of the interior or exterior edges. If you're getting close to an edge, the better approach, depending on your mesh size, may be to break the curve instead.
Grudy, The API worked fine in FEMAP API window. I'm using .net now to do exactly the same. Even when a curve is not intersecting the surface, fecoordsurfaceIntersect function is creating a point at 0,0,0. Though i have <> FE_FAIL, its still not skipping the loop. I have attached the screenshot. Not sure where i'm going wrong. Could you please take a look at it. Thank you.
Try ...<>FE_NOT_EXIST instead of ...<>FE_FAIL. There isn't FE_FAIL return code in feCoordSurfaceIntersect method according to the FEMAP v11.4.0 Help.
Thanks for the reply Peter.
FE_NOT_EXIST is not helping too. Wondering What can trigger this...FE_FAIL and FE_NOT_EXIST both works fine within FEMAP. Not sure why its not working in Visual Studio.
You could rewrite the line:
"If App.feCoordSurfaceIntersect(iCurveSet.CurrentID, iSurface.ID, Point1, Point2) <> femap.zReturnCode.FE_FAIL Then"
If App.feCoordSurfaceIntersect(iCurveSet.CurrentID, iSurface.ID, Point1, Point2) = femap.zReturnCode.FE_OK Then
That way, you don't have to worry which error you are checking for.
I removed FE_FAIL /FE_NOT_EXISTand used femeasuredistancebetweengeometry to find if a curve and surface are intersecting. If intersecting then i use fecoordsurfaceintersect. Still i'm getting an errocode of 8 which is FE_BAD_TYPE (pic attached). This is creating a point at (0,0,0) and not on the intersection. Not sure why i'm getting 8 instead of -1.