Error "a constant value is expected" on convert VB.Net to C#

Error "a constant value is expected" on convert VB.Net to C#

Maxim-CADman77
Advisor Advisor
213 Views
1 Reply
Message 1 of 2

Error "a constant value is expected" on convert VB.Net to C#

Maxim-CADman77
Advisor
Advisor

Nowadays I practice my C# skill via converting some Autodesk-Invetor-related VB.Net code.

Here is the line where Visual Studio compiler finds "a constant value is expected" Error:

if (((Face)oBFs[2]).Geometry.GetType() is typeof(Plane))

"oBFs" (presumably collection of Faces) was got with SurfaceBody.FindUsingRay method:

oSB.FindUsingRay(origin, normal, 0.001, out ObjectsEnumerator oBFs, out ObjectsEnumerator oBPts, true);

What I'm missing?

 

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Accepted solutions (1)
214 Views
1 Reply
Reply (1)
Message 2 of 2

Maxim-CADman77
Advisor
Advisor
Accepted solution

answer - just remove "typeof"

PS: Is it possible to delete thread?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes