Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Measure components of an assembly journal 1

Status
Not open for further replies.

Derwood785

Mechanical
Aug 29, 2013
22
CA
Hi everyone.

I am looking for a journal that can measure the components of an assembly. The journal would need to process each component of the assembly and measure the solid body found on layer 1, obtain X, Y and Z values and assign them to the part attributes. I have found a journal that looks like it could do the job in thread561-389240 written by cowski. I would like to change the solid body search to find the solid body only on layer 1. I have false bodies in the part file that I want to avoid measuring. I am not sure about how to do this.

Thanks in advance

 
Replies continue below

Recommended for you

If you are using the "AskAllBodies" function found in the linked thread, you could check the layer that the body is on before adding it to the list:

Code:
Function AskAllBodies(ByVal thePart As Part) As List(Of Body)

    Dim theBodies As New List(Of Body)

    Dim aBodyTag As Tag = Tag.Null
    Do
        theUfSession.Obj.CycleObjsInPart(thePart.Tag, _
            UFConstants.UF_solid_type, aBodyTag)
        If aBodyTag = Tag.Null Then
            Exit Do
        End If

        Dim theType As Integer, theSubtype As Integer
        theUfSession.Obj.AskTypeAndSubtype(aBodyTag, theType, theSubtype)
        If theSubtype = UFConstants.UF_solid_body_subtype Then
            dim theBody as body = utilities.NXObjectManager.Get(aBodyTag)
            [highlight #FCE94F]if theBody.Layer = 1 then[/highlight]
                [highlight #FCE94F]theBodies.Add(theBody)[/highlight]
            [highlight #FCE94F]end if[/highlight]

        End If
    Loop While True

    Return theBodies

End Function

www.nxjournaling.com
 
Is there a way to add this function to the program that you posted? That program already adds the values to the attributes for me.

Thanks
 
Thanks for the post. With only a bit of work I was able to get this going. This will be a time saver for us. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top