Surface bodies

Surface bodies

Anonymous
Not applicable
259 Views
3 Replies
Message 1 of 4

Surface bodies

Anonymous
Not applicable
IV 10: I found this line in the constraints help area. "One way to obtain these faces is by iterating through all the faces that make up the surface body of each component occurrence" How can one accomplish this? Can you do the same on an assembly w/ several parts?

Thanks

Eric
0 Likes
260 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
You basically need to iterate over all component occurrence objects in the
assembly and then iterate over the faces of the body corresponding to each
occurrence. Here is some sample code to help...

Sub FacesInAssembly()
Dim odoc As AssemblyDocument
Set odoc = ThisApplication.ActiveDocument

Dim odef As AssemblyComponentDefinition
Set odef = odoc.ComponentDefinition

Dim oOccurrence As ComponentOccurrence

For Each oOccurrence In odef.Occurrences

Dim oFace As Face

For Each oFace In oOccurrence.SurfaceBodies.Item(1).Faces
'...
'...
Next
Next

End Sub

Sanjay-


wrote in message news:5238809@discussion.autodesk.com...
IV 10: I found this line in the constraints help area. "One way to obtain
these faces is by iterating through all the faces that make up the surface
body of each component occurrence" How can one accomplish this? Can you do
the same on an assembly w/ several parts?

Thanks

Eric
0 Likes
Message 3 of 4

Anonymous
Not applicable
That is a big help. Answer me this: How can I programatically select a particular face of an assembly in Autodesk IV 10?
0 Likes
Message 4 of 4

Anonymous
Not applicable
There are many ways to get a face, which one to use depends on what you're
doing. The simplest method is to have the end-user select it before running
your program. You can then get the selected face from the
Document.SelectSet object. Another method is to have the end-user select
the face as part of your program, where you have more control over the
selection process. Another way is to look through all of the faces in the
assembly and find the face you want. This can be difficult because there
needs to be something special about the face you want (size, orientation,
etc.) so that you can find it. Another way is to have previously "named"
that face so you can find it later. This naming could have been done with a
small program that attaches an attribute to it or it could be by finding a
particular iMate and getting the associated face.

As you can see, there isn't a simple answer but I suspect there are enough
tools to do what you want.
--
Brian Ekins
Autodesk Inventor API


wrote in message news:5240573@discussion.autodesk.com...
That is a big help. Answer me this: How can I programatically select a
particular face of an assembly in Autodesk IV 10?
0 Likes