API Help

I've written some Vb code to create a blind hole, (featureCut). I need to selected the face at the bottom of the hole to insert a sketch. I can get the face object and even find it's area, but cannot find a way to select the face to insert a sketch. Below is some of my code. I can pick the face using SelectById and the correct x,y,z values but I would need to covert these values to Model space values from the sketch coordinates. I was hoping for an eaiser way.

Thanks Warren

Set FeatureO = FeatureMgr.FeatureCut(True, False, False, 0, 0, 0.00635 * 2,

0.00254, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 0, 1, 1)

FaceArray = FeatureO.GetFaces 'get face array rtnval = FeatureO.GetFaceCount ' face count Set FaceO = FaceArray(0) 'get face#0

Set rtnval = selMgr.GetSelectedObject4(1) ' returns false

rtnval = ModelExt.SelectByID("", "FACE", x1, y1, 0.00635, False, 0, Nothing) Modeldoc.InsertSketch2 (True) 'creates sketch cursor in Solidworks because no face is selected

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----

formatting link
The #1 Newsgroup Service in the World! >100,000 Newsgroups

---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Reply to
Warren
Loading thread data ...

If you know things about your face, the best is to use Feature.GtFaces or Body.GetFirstFace + Face.GetNetFace to find it in the geometry, then simply Face.Select

Reply to
Philippe Guglielmetti

Thanks, needed to a add value, true/false but it works!!! Face.Select(True) Why is this not documented? Are there many undocumented commands?

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----

formatting link
The #1 Newsgroup Service in the World! >100,000 Newsgroups

---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

Reply to
Warren

Face.Select(True)

it IS documented : Entity::Select ... A Face is an Entity, in OO words the Face class derives from then Entity class, so all methods from entity can be called from a Face object.

Now I agree the SW API class hierarchy isn't the most clear thing on Earth. We're all waiting for a class diagram in apihelp. I made one for my C++ class wrapper that might help:

formatting link

Reply to
Philippe Guglielmetti

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.