Faces, Assembly Constrains and so on...

Faces, Assembly Constrains and so on...

Anonymous
Not applicable
241 Views
1 Reply
Message 1 of 2

Faces, Assembly Constrains and so on...

Anonymous
Not applicable
Hi.

I have the follow situation: Two parts inserted into a assembly file. In each part I have an assembly constrain join them. Now, I'd like automatically get the Faces where the constrains are there.

For example: the two parts are cubes. One cube has six sides. So, I want get the face index where is there the constrain.

How can I do it? Someone has an idea?

Mac
0 Likes
242 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
The entities on the part that the constraint is
tied to are available through the EntityOne and EntityTwo properties of the
AssemblyConstraint object.  The code below is a simple example that
highlights the entities associated with each constraint.

 

Public Sub
ShowConstraintFaces()
    ' Get a reference to the assembly
component definition.
    Dim oAsmCompDef As
AssemblyComponentDefinition
    Set oAsmCompDef =
ThisApplication.ActiveDocument.ComponentDefinition
   

    ' Get a reference to a particular part.  This just
gets
    ' the first one in the browser.
   
Dim oOcc As ComponentOccurrence
    Set oOcc =
oAsmCompDef.Occurrences.Item(1)
   
    '
Create a highlight set to use in displaying the entities
    '
used for the constraints.
    Dim oHS As
HighlightSet
    Set oHS =
ThisApplication.ActiveDocument.HighlightSets.Add
    Call
oHS.SetColor(0, 255, 0)
   
    ' Iterate
through each of the constraints on the occurrence.
    Dim
oConstraint As AssemblyConstraint
    For Each oConstraint In
oOcc.Constraints
        ' Highlight the
two entities used for the
constraint.
        oHS.AddItem
oConstraint.EntityOne
        oHS.AddItem
oConstraint.EntityTwo

 

        MsgBox
"Entities for constraint """ & oConstraint.Name & """ are
highlighted."
       

        oHS.Clear
   
Next
End Sub

 

-Brian


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi.

I have the follow situation: Two parts inserted into a assembly file. In
each part I have an assembly constrain join them. Now, I'd like automatically
get the Faces where the constrains are there.

For example: the two parts are cubes. One cube has six sides. So, I want
get the face index where is there the constrain.

How can I do it? Someone has an idea?

Mac

0 Likes