EnumAuxFiles Execution Error

 
 
 
Posted by:SRY
Data created:22 February

I want to collect texture maps through it,I write all my codes in c#.But report an error!

 

<span class="lia-message-image-wrapper lia-message-image-actions-narrow lia-message-image-actions-below"><img class="lia-media-image" title="_20240220105721.jpg" src="https://forums.autodesk.com/t5/image/serverpage/image-id/1327991iAD244F57917253E1/image-size/medium?v=v2&px=400" alt="_20240220105721.jpg" /></span>

the following is my codes:

private void PasteFeedBack_Click(object sender, RoutedEventArgs e)
{
try
{
SRYAssetEnumCallback Addmap = new SRYAssetEnumCallback();
GlobalInterface.Instance.COREInterface.EnumAuxFiles(Addmap, 0);
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}

--------------

public class SRYAssetEnumCallback : IAssetEnumCallback
{
private List<string> NameList = null;
private static List<string> PathList = null;
public List<string> BitmapPaths
{
get { return PathList; }
set { PathList = value; }
}

public IntPtr NativePointer => throw new NotImplementedException();

public void Dispose()
{
throw new NotImplementedException();
}

public bool Equals(IAssetEnumCallback other)
{
throw new NotImplementedException();
}

public void RecordAsset(IAssetUser asset)
{
if (!NameList.Contains(asset.FileName))
{
NameList.Add(asset.FileName);
PathList.Add(asset.FullFilePath);
}
}
}

Error prompt:
unable to cast object of type 'YunTuCore.SRYAssetEnumCallback' to type 'Autodesk.Max.IImplementable'

Please check, there should be Autodesk.Max.Plugins.AssetEnumCallback class from which their class should be derived, not from IAssetEnumCallback

Marsel Khadiyev (Software Developer, EPHERE Inc.)

Hi EPHERE, You are right,It's Great!You've done me a great favor!thanks