3DS Max 2025, NET Core 8 error in C#, Autodesk.Max.dll can not apply indexing with [] to an expression of type IBitArray

3DS Max 2025, NET Core 8 error in C#, Autodesk.Max.dll can not apply indexing with [] to an expression of type IBitArray

tuiday17
Explorer Explorer
869 Views
1 Reply
Message 1 of 2

3DS Max 2025, NET Core 8 error in C#, Autodesk.Max.dll can not apply indexing with [] to an expression of type IBitArray

tuiday17
Explorer
Explorer

Dear Support Team,

I am trying on update a Plugin from 3ds Max 2024 (.NET Framework) to 3ds Max 2025 (.NET Core 8). My code in C# as bellow:

        IPolyObject opoly;
        //...

        IMNMesh omesh = opoly.Mesh;
        IBitArray fsel = g.BitArray.Create();
        so = omesh.FNum;//omesh.Numf;
        fsel.SetSize(so, 0);
        omesh.GetFaceSel(fsel);

        for (int i = 0; i < so; i++)
        {
          if (fsel[i] != 1) continue;
          IPoint3 v3d = omesh.GetFaceNormal(i, true);
          //...

 

but in Visual Studio 2022 editor show Error:

aaa.png

 

Could you help me fix this error? But I think something is different from "Autodesk.Max.dll" 2025

 

Best Regards,

DMD

0 Likes
870 Views
1 Reply
Reply (1)
Message 2 of 2

sharfym
Contributor
Contributor

Try IBitArrayValue     SelectionIterator.Selected to check

 

IPolyObject opoly;
//...

IMNMesh omesh = opoly.Mesh;
IBitArray fsel = g.BitArray.Create();
so = omesh.FNum;//omesh.Numf;
fsel.SetSize(so, 0);
omesh.GetFaceSel(fsel);

IBitArrayValue fselv = GlobalInterface.Instance.BitArrayValue.Create(fsel);

for (int i = 0; i < so; i++)
{
if (fselv.SelectionIterator.Selected(i) == false) continue;
IPoint3 v3d = omesh.GetFaceNormal(i, true);
//...

0 Likes