×
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

Using ug_inspect to check if flat pattern entity exist in a part

Using ug_inspect to check if flat pattern entity exist in a part

Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Hi,

Is it possible to use ug_inspect to check if flat pattern entity exist in a part ?

If not:

Is it possible to use ug_inspect to check if a special layer is not empty ?

Thanks in advance

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

No and no. The ug_inspect utility has a specific use; it cannot be extended to check for flat patterns or the status of layers.

However, a journal could be made to do either (or both) of the tasks that you mentioned...

www.nxjournaling.com

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Thanks Cowski,

Unfortunatly, I am not an expert in vb :(

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

Here's a quick journal that will tell you if the work part contains a flat pattern or not.

CODE

Option Strict Off
Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        If IsNothing(theSession.Parts.BaseWork) Then
            'active part required
            Return
        End If

        Dim workPart As Part = theSession.Parts.Work
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        Const undoMarkName As String = "check for flat pattern"
        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName)

        Dim fpFound As Boolean = False

        For Each tempFeature As Features.Feature In workPart.Features

            If TypeOf (tempFeature) Is Features.FlatPattern Then
                fpFound = True
                lw.WriteLine("workpart contains flat pattern")

            End If

        Next

        If Not fpFound Then
            lw.WriteLine("workpart does NOT contain a flat pattern")
        End If

        lw.Close()

    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image immediately after execution within NX
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

    End Function

End Module 

www.nxjournaling.com

RE: Using ug_inspect to check if flat pattern entity exist in a part

A simple Check-Mate profile can be created. Below is an example which flags the presence of a flat pattern as information:-

Cheers,

NXJockey

#! NX/KF 3.0
#

DefClass: check_for_flat_pattern ( %ug_base_checker );
( String ) %test_category: "MyCustomChecks.Modelling";
( String ) %displayed_name: "Check For Flat Pattern";
( Boolean Parameter ) Disabled?: False;
( Boolean Parameter ) save_log_in_part: False;

# Attributes for this class
( List Modifiable ) flat_ptrn: mqc_askObjectOfType( True, 64, 7, "lib", "libufmqc", "Name", "mqc_ufkf_askObjectOfType" );

# Checker function
(Any Uncached) do_check:
If ( (-Empty?(flat_ptrn:)) )
Then (mqc_log( LOG_INFO, flat_ptrn:, "Part contains a flat pattern"))
Else (donothing);

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Thanks a lot Cowski, It's exactly what I am looking for

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Hi NXJockey,

Thanks for your help, but I have the following error message:

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

Hi, try just putting the dfa file in your checkmate directory

Cheers,

NXJockey

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Hi NXJockey,

I have set up my own dfa directory, but where is my test ?



Thanks in advance

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Hi Cowski,

Could you change the journal to check all parts in the opening assembly ?

Thanks in advance

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

RE: Using ug_inspect to check if flat pattern entity exist in a part

Hi,

The checkmate directory is listed in the ugii_env.dat. It's this dir which controls the checkmate profiles

Cheers

NXJockey

RE: Using ug_inspect to check if flat pattern entity exist in a part

With regderence to the above, a simple way to set up the abouve checker is as follows.

1.) CREATE A FOLDER CALLED 'checkmate'
2.) CREATE A SUB FOLDER WITHIN THE CHECKMATE FOLDER CALLED 'DFA'
3.) STORE THE FILE IN THE DFA FOLDER
4.) CREATE A LOCAL ENVIROMENT VARIABLE:-
UGCHECKMATE_USER_DIR=**** YOUR PATH TO THE FOLDER ****\checkmate\DFA
5.) START NX

Cheers,

NXJockey

RE: Using ug_inspect to check if flat pattern entity exist in a part

(OP)
Hi NXJockey,

I was on another subject for few days and I come back to day to this one to thank you. I succeed.

Now I will start a new thread because the tittle of this one is not adapted.

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

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