×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Error NXOpen: ModelCompare function API called UF_MODL_model_compare

Error NXOpen: ModelCompare function API called UF_MODL_model_compare

Error NXOpen: ModelCompare function API called UF_MODL_model_compare

(OP)

Hello,

I have following error (see in a picture below) while debugging Model Compare function in both NX 10 & 11 Environment. Can anyone help me to solve this error and I didn't understand what the meaning of "an RM Object has an unsuitable OM class."
Or anyone suggests me if there is any mistake in code.

CODE --> vb.net

Function MyModelCompare(ByVal iListWindow As ListingWindow, ByRef iPart1 As Part, ByRef iPart2 As Part) As ComparePartMapData


        Try
           
          Dim intPart1Tag As NXOpen.Tag = iPart1.Tag         'Tag derived from input part1 
            Dim oBody_Eids_Part1 As Tag = CType(vbNull, NXOpen.Tag)
             'Dim oPartTransform1 As Double()
            Dim intPart2Tag As NXOpen.Tag = iPart2.Tag
            Dim oBody_Eids_Part2 As NXOpen.Tag = CType(vbNull, NXOpen.Tag)
             'Dim oPartTransform2 As Double()


           'iListWindow.WriteLine(TypeName(nxMappingData))
            iListWindow.WriteLine("Part1 Tag: " & CStr(intPart1Tag))
            iListWindow.WriteLine("oBody_Eids_Part1: " & CStr(oBody_Eids_Part1))
            iListWindow.WriteLine("intPart2Tag: " & CStr(intPart2Tag))
            iListWindow.WriteLine("oBody_Eids_Part2: " & CStr(oBody_Eids_Part2))



            Dim theUFSession As UFSession = Nothing
            
            Try
                theUFSession = UFSession.GetUFSession()
                If Not theUFSession Is Nothing Then
                    ilistWindow.WriteLine("Session Tag: " + CStr(theUFSession.Tag.ToString))
                Else
                    iListWindow.WriteLine("Session is nothing!")
                End If
            Catch ex As Exception
                MsgBox(ex.Message.ToString)
            End Try

            'Initialize nx CompareMapdata
            
            Dim nxMappingData As ComparePartMapData
            theUFSession.Modl.InitializeCompareData(nxMappingData)

            iListWindow.WriteLine("NX identical parts value = " + CStr(nxMappingData.identical_parts))
            iListWindow.WriteLine(nxMappingData.part1.edges.num_entities.ToString)

            iListWindow.WriteLine("UF Session derived!")
            Dim a_mtx4Identity(15) As Double
            theUFSession.Mtx4.Identity(a_mtx4Identity)


            Dim oModl As UFModl = Nothing
            Try
                oModl = theUFSession.Modl
            Catch ex1 As Exception
                iListWindow.WriteLine("Unable to get Modl object!")
            End Try

            'Try
            '    theUFSession.Modl.FreeCompareData(nxMappingData)
            'Catch ex1 As Exception
            '    Throw New Exception("Error with FreeCompareData3!")
            'End Try

            Dim dblTolerance As Double = 0.001
            Try


                oModl.ModelCompare(intPart1Tag,
                                    oBody_Eids_Part1,
                                    a_mtx4Identity,
                                    intPart2Tag,
                                    oBody_Eids_Part2,
                                    a_mtx4Identity,
                                    True,
                                    CompareAccuracy.CompCoarse,
                                    dblTolerance,
                                    CompareIdenticalfaceRule.CompAlledges,
                                    CompareChangeduniquefaceRule.CompNonidenticalsfChanged,
                                    False,
                                    nxMappingData)

            Catch ex1 As Exception
                Throw New Exception(ex1.message.Tostring)
            End Try

            Return nxMappingData
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Function 

RE: Error NXOpen: ModelCompare function API called UF_MODL_model_compare

According to the API docs, you should probably be using the .ModelCompare3 method. Try .ModelCompare3 and see if you get the same error.

www.nxjournaling.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources