Cancel
Showing results for 
Search instead for 
Did you mean: 

API to add Meshpoints

Pioneer
Pioneer

Hello,

 

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.

11 REPLIES

Re: API to add Meshpoints

Siemens Phenom Siemens Phenom
Siemens Phenom

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()

Re: API to add Meshpoints

Siemens Genius Siemens Genius
Siemens Genius

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.

Re: API to add Meshpoints

Pioneer
Pioneer
Thank you!

Re: API to add Meshpoints

Pioneer
Pioneer

Thank you.

Re: API to add Meshpoints

Pioneer
Pioneer

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.

Re: API to add Meshpoints

Legend
Legend

Hello Kannan_R,

 

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.

 

Best regards,

 

Peter Kaderasz

Re: API to add Meshpoints

Pioneer
Pioneer

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.

Re: API to add Meshpoints

Siemens Phenom Siemens Phenom
Siemens Phenom

You could rewrite the line:

 

"If App.feCoordSurfaceIntersect(iCurveSet.CurrentID, iSurface.ID, Point1, Point2) <> femap.zReturnCode.FE_FAIL Then"

 

To:

 

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.

 

 

Re: API to add Meshpoints

Pioneer
Pioneer

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.