Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to get the object of UF.UFModl using NX open ?

Status
Not open for further replies.

biw01

Automotive
Dec 31, 2011
152
Hello everyone ,

I need to get the symbolic thread parameters using NX open code, but to access the API "AskSymbThreadParms" i need to get the object of UF.UFModl.

Can someone please let me know how can i get the object of UF.UFModl in my code.

Regards,
Amitabh
 
Replies continue below

Recommended for you

Basic steps are:[ol 1]
[li]import the UF namespace[/li]
[li]create a UFSession object[/li]
[li]call the UF function from your UFSession object[/li]
[/ol]

example code:
Code:
[COLOR=blue]Option[/color] [COLOR=blue]Strict[/color] [COLOR=blue]Off[/color]  
[COLOR=blue]Imports[/color] System  
[COLOR=blue]Imports[/color] NXOpen  
[highlight]Imports NXOpen.UF[/highlight]

[COLOR=blue]Module[/color] Module1  

    [COLOR=blue]Sub[/color] Main()  

        [COLOR=blue]Dim[/color] theSession [COLOR=blue]As[/color] Session [COLOR=blue]=[/color] Session.GetSession()  
        [highlight]Dim ufs As UFSession = UFSession.GetUFSession()[/highlight]

        [COLOR=blue]Dim[/color] thread_tag [COLOR=blue]As[/color] Tag [COLOR=blue]=[/color] Tag.Null  
        [COLOR=blue]Dim[/color] thread_data [COLOR=blue]As[/color] UFModl.SymbThreadData  

 [COLOR=green]'[/color]
 [COLOR=green]'[/color]
 [COLOR=green]'[/color]

        [highlight]ufs.Modl.AskSymbThreadParms(thread_tag, thread_data)[/highlight]

    End [COLOR=blue]Sub[/color]  


    [COLOR=blue]Public[/color] [COLOR=blue]Function[/color] GetUnloadOption(ByVal dummy [COLOR=blue]As[/color] [COLOR=blue]String[/color]) [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  

 [COLOR=green]'Unloads the image when the NX session terminates[/color]
        GetUnloadOption [COLOR=blue]=[/color] NXOpen.Session.LibraryUnloadOption.AtTermination  

    End [COLOR=blue]Function[/color]  

End [COLOR=blue]Module[/color]


www.nxjournaling.com
 
Thank you cowski, the solution works perfectly.
I was doing the steps 1 and 2 but missing the 3rd step.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor