Knowledge Fusion Language FAQ

Overview

Related Topics


What is a mix-in?

a mix-in is a non-instantiable base class from which another class can inherit attributes. When you define a new class, you can include one or more mix-ins and inherit all the attributes from the mixed-in classes. For example, ug_line inherits color and layer attributes from ug_displayable_entity.

What is a hostpointer and when do I use it?

A hostpointer is a nonpersistent Knowledge Fusion identifier (tag) for an NX object. Though Knowledge Fusion has a good number of base classes to cover most of the commonly used NX objects or features, this coverage is not complete. In such circumstances, you can refer to non-Knowledge Fusion NX objects through their tags. In such cases, the data type is "Any" and you can pass these tags to Knowledge Fusion. You can then access the tags through NX Open API code. A word of caution, tags are always transient so you need to be extra careful while handling tags. For example, if you had a hostpointer to an NX/View object, then you can retrieve this tag using one of the Knowledge Fusion functions like ug_refObjectByName and pass the name of the view to get the tag. If this were hardcoded then on subsequent invocations the tag can be garbled.

Why doesn't the color attribute work for system classes like ug_block?

ug_block is a feature and does not have a color attribute. You can control the feature's color, layer, density, etc. with the ug_body class. You input the feature name into ug_body's feature attribute then change the color attribute to the color of your choice.

Why doesn't the DFA Manager list my DefClass in the Choose Files for Syntax Check list box?

The language ignores comments for DefClass and Defun.

If you declare a commented DefClass name in one DFA file and fully declare and define the same DefClass name without comments in a second DFA file, the system does not display the second DFA file in the Choose Files for Syntax Check option of the DFA Manager.

For example:

--afirst.dfa--

 #! UG/KF 17.0 DefClass: afirst(ug_base_part); (number) aaa: 9; #+ DefClass: bsecond(ug_base_part); #-   

--bsecond.dfa--

 #! UG/KF 17.0 DefClass: bsecond(ug_base_part); (number) bbb: 12; 
Why am I having problems when using the ug_createInstance() function?

Use the %ug_create_instance class as a mix-in to invoke the  ug_createInstance() function via the %apply_ug_createInstance callback.

Why do I get a "failed to load part" message when I apply a change to a child rule?

This type of message can occur if you reference a part name that is missing or incorrect. If you write rules that reference file names in NX Knowledge Fusion then you must modify those rules whenever the file is renamed.

For example, if you write a rule that is referencing a part file named "a.prt" and you rename the part file to "b.prt", then you must modify the rule to reference the new file name.

If you do not then you will get an error from KF when it tries to execute the rule.

You need to think about this whenever you:

and so on.