Notifications
Clear all

[Closed] xrefs.getXRefFileCount() not working?

I am probably making a very stupid mistake but I have this problem:
I am trying to list all the xref objects in my scene in order to process them later.

My scene has 10 xref objects, one of the has 2 sub-xrefs

WHen I run this, it gives as result 0, as if there were no xrefs in my scene…

print (xrefs.getXRefFileCount())

I have no clue what I am doing wrong

2 Replies

Object Xrefs and Scene Xrefs are two pair of shoes

If you use Object Xrefs ( as you mention in your post ), you should use the respective commands/data structs which is objXRefMgr in that case

objXRefMgr.recordCount

The above reports the count of objXref records ( individual files )
Once you got that you have to check each file record for the number of object xrefs .
See docs here

<DWORD><IXRefRecord MixinInterface>.ItemCount <&enum array>types

types enums: {#XRefObjectType|#XRefMaterialType|#XRefAtmospheric Type|#XRefAllType}
types is In parameter

http://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_4822E768_D5EF_44EF_89E7_5BF5404861A2_htm

Thank you!! :applause: