and to assign materials to 3D objects, the material object name should be an item in the collection to be able to add it to any object with the function:
Thank you Tharwat, but i have to say that i still don't get this :) To i have to move my custom material from my material library first to the document material library? and can dis be done via LISP or VLA?
I think yes it is possible and we can try that since we would loss nothing
We can create a temporary 3D object and assign the materials that you want to use to it , then delete the temporary object so the materials would be available in current drawing.
Upload a few material to see the type of these files.