when importing an IFC through VisualARQ, the object material gets transferred nicely as the object’s material. However, it would be good to have the option to have the materials’ diffuse color be set as the object’s color as well. Then I would not have to set to render view, in order to see the color.
I have a script that does this after import, but it (understandably) doesn’t work for block objects. Hence, it would be preferable if these colors could be set during the import process, when the block structure is generated.
Option Explicit Sub SetObjectColorsFromMaterialColors Rhino.EnableRedraw(False) ' Constants Const rhColorByLayer = 0 Const rhColorByObject = 1 ' Variables Dim aObjects, sObject Dim nColor, nSource Dim sLayer, nMaterial ' Get all objects in the document aObjects = Rhino.GetObjects("pick objects",,, True) If Not IsArray(aObjects) Then Exit Sub ' Process each object For Each sObject In aObjects 'get object material color nMaterial = Rhino.ObjectMaterialIndex(sObject) nColor = Rhino.MaterialColor(nMaterial) 'assign material color as object color Call Rhino.ObjectColor(sObject, nColor) Next ' Redraw the document Rhino.EnableRedraw(True) End Sub Call SetObjectColorsFromMaterialColors