Model.GetFaces
Model.GetFaces
(OP)
I am using this command in my macro to get all the faces in a sections. Does anyone know how the .getfaces array works? For example, if I have 3 faces, I want to break it up into three difference sets (Face1, Face2, Face3). I tried to extract anything out of the array with no success. Any ideas?
Thanks.
Thanks.






RE: Model.GetFaces
Regards
RE: Model.GetFaces
CODE
selType = swSelMgr.GetSelectedObjectType2(1)
Set selEntity = swSelMgr.GetSelectedObject3(1)
Set swModelExt = Part.Extension
Faces = selEntity.GetFaces()
FaceCount = selEntity.GetFaceCount()
From here I want to be able to get the select the first face. I believe it has something to do with the Selection Manager in SW but not sure. Thanks for your help.
RE: Model.GetFaces
You need to traverse faces with commands Body2.GetFirstFace and Face2.GetNextFace.
I have an example in an addin tutorial I plan to post this weekend. This is a small excerpt. I use a program to randomly color all faces as a jumping-off point to illustrate how to turn an .exe into an addin .dll in VB. Excerpt below. Hope it helps.
CODE
Set swBody = swBodies(I)
Set swFace = swBody.GetFirstFace
Do While Not swFace Is Nothing
RandomColor = swBasicColors(Int(swBasicColorCount * Rnd))
retBool = swFace.Select3(False, 0, retObj)
retBool = ThisPart.Model.SelectedFaceProperties(RandomColor, CDbl(pProps(3)), CDbl(pProps(4)), _
CDbl(pProps(5)), CDbl(pProps(6)), CDbl(pProps(7)), CDbl(pProps(8)), _
False, vbNullString)
Set swFace = swFace.GetNextFace
Loop
Next
http://www.EsoxRepublic.com
RE: Model.GetFaces