×
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

KF Code Error for ug_askminimumdistance function.

KF Code Error for ug_askminimumdistance function.

KF Code Error for ug_askminimumdistance function.

(OP)
HI All,
using NX 8.5.3.3 and TC 8.
I have assembly where number of components are assembled. Now I have a specific list of component(Flanges) which I am getting through KF Code.
Now, I have to get the minimum distance between two closest flanges. For that I am comparing each flange with remaining list of flanges. (That's what my intention is !!)
But when code is entering into "ug_askminimumdistance" function. It is displaying me "Datatype Mismatch (Function Argument)" error. I have attached error hereby.
Is there a problem using ug_askminimumdistance function directly on components ?? If yes, then what is alternative?
any help/suggestion appreciated.

RE: KF Code Error for ug_askminimumdistance function.

(OP)
Can anybody help me with the ug_askminimumdistance function use ?

RE: KF Code Error for ug_askminimumdistance function.

Hi, ckadam.

I work with quite similar issue now. First question for you - are you sure that your objects are Ug_component(it's not clear from code you provided) If it's so - it's the reason of error, because ug_askminimumdistance works with points, curves, datum_planes, edges, faces, solids, sheets or features (Including UDFS) only. I think you guessed it by now :)

But it is only first difficulty. Next is geometry in assembly itself, when objects belong to different components with different locale frames.

I work with existing assembly in nx4, need to execute some functions like ug_askMinimumDistance. I try to create linked objects this way:

#! UGNX/KF 2.0
DefClass: a_list_90_asm_extract (ug_base_part);

(list Parameter) Sel_Edge1_old: {};
(List) Sel_Edge1_old_Mode: {xform_path};
(List) Sel_Edge1_old_Mask: {Edge, Any_in_Assembly};

(any) Sel_edge1_host: First(Flatten(Sel_edge1_old:));
(any) Sel_edge1_path: ug_adoptObject(Second(Flatten(Sel_edge1_old:)));
(Child) Sel_edge1_Linked:
{
Class, ug_extract_curve;
File_Name, nth(3,(Flatten(Sel_edge1_old:)));
Object_Name, Sel_edge1_host:;
FromPath, {Root,ug_askCurrentWorkPart(),Sel_edge1_path:};
};
(list) Sel_edge1: {Sel_edge1_Linked:};

(Point) Sel_point1: ug_curve_askStartPoint(nth(1,Sel_Edge1:));

but received the error "Component Instance in Path Not Found"

What is wrong? As i understand, FromPath has to be a list of 3 members: Root, filename of component file and instance of component, which determines frame of my object. When i avoid parameter FromPath, programm made linked object at wrong place, so it has to be provided.

2) How to work with ug_extract_curve then? All geometry functions demand ug_curve, but ug_extract_curve is a child of ug_feature, so functions raise errors "missing type..."

Mayby you or anybody know?

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