engiEvaluateScriptExpression

This function can evaluate EXPRESS expression for entity where rule or derived attribute, valueType, value and return type work similary to sdaiGetAttr.

Syntax

public const string ifcenginedll = @"ifcengine.dll";

[DllImport(IFCEngineDLL, EntryPoint = "engiEvaluateScriptExpression")]
public static extern Int32 engiEvaluateScriptExpression(int_t model, int_t instance, int_t expression, int_t valueType, out bool value);

[DllImport(IFCEngineDLL, EntryPoint = "engiEvaluateScriptExpression")]
public static extern Int32 engiEvaluateScriptExpression(int_t model, int_t instance, int_t expression, int_t valueType, out int_t value);

[DllImport(IFCEngineDLL, EntryPoint = "engiEvaluateScriptExpression")]
public static extern Int32 engiEvaluateScriptExpression(int_t model, int_t instance, int_t expression, int_t valueType, out double value);

[DllImport(IFCEngineDLL, EntryPoint = "engiEvaluateScriptExpression")]
public static extern Int32 engiEvaluateScriptExpression(int_t model, int_t instance, int_t expression, int_t valueType, out IntPtr value);

public static Int32 engiEvaluateScriptExpression(int_t model, int_t instance, int_t expression, int_t valueType, out string value)
        {
            value = null;
            valueType = getStringType(valueType);
            if (valueType != 0)
            {
                IntPtr ptr = IntPtr.Zero;
                var ret = engiEvaluateScriptExpression(model, instance, expression, valueType, out ptr);
                if (ret != 0 && ptr != IntPtr.Zero)
                {
                    value = marshalPtrToString(valueType, ptr);
                    return ret;
                }
            }
            return 0;
        }    

Property model

Size: 32 bit / 4 byte (value)
???.

Property instance

Size: 32 bit / 4 byte (value)
...

Property expression

Size: 32 bit / 4 byte (value)
???.

Property valueType

Size: 32 bit / 4 byte (value)
...

Property value

Size: 32 bit / 4 byte (reference)
...