开发者

How can I check the value of a Fluid Contact type?

开发者 https://www.devze.com 2023-03-12 19:35 出处:网络
I want to retrieve data from a fluid contact set only if the contact is from a certain type. This is what开发者_如何学运维 i wrote:

I want to retrieve data from a fluid contact set only if the contact is from a certain type.

This is what开发者_如何学运维 i wrote:

ContactSet fcset = FcSetGridBox.Tag as ContactSet; 
foreach (Contact fc in fcset.Contacts) 
{ 
    if (fc.ContactType.Equals(oilwater)) 
    { 
        args.OilZoneContV=fc.GetZValue(); 
    } 
    else 
    if (fc.ContactType = "oilgas"') 
    { 
        args.GasZoneContV = fc.GetZValue(); 
    } 
} 

But I don't know what to compare the ContactType to.

The Ocean manual mention the contact type enumeration but i cant use them as string


I just found the answer: I need to test against the actual enumeration values.

if (fc.ContactType.Equals(ContactType.OilGas))
{ ... }

And Enumerations can safely be compared with the == operator as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号