BIM Coordinator Program (INT) April 22, 2024

Find the next step in your career as a Graphisoft Certified BIM Coordinator!

Archicad C++ API
About Archicad add-on development using the C++ API.

How to create new texture material

Anonymous
Not applicable

			API_Attribute      attrib;
			API_RGBColor	   rgbC;
			short              ltypeIndex;
			GSErrCode          err;

			BNZeroMemory (&attrib, sizeof (API_Attribute));
			BNZeroMemory (&rgbC, sizeof (API_RGBColor));
			attrib.header.typeID = API_MaterialID;
			rgbC.f_red = 1.0;		rgbC.f_green = 0.0;		rgbC.f_blue = 0.0;

			//SetOption
			attrib.material.ambientPc = 66;
			attrib.material.diffusePc  = 90;

			//Color Mode
			//attrib.material.emissionRGB  = rgbC;

			//Select picture
			GS::UniString	tmp ("material_pic");
			GS::ucsncpy (attrib.material.texture.texName, tmp.ToUStr(), 100 / sizeof (GS::UniChar) - 1);
			//Set name
			sprintf (attrib.material.head.name, "material_test");

			err = ACAPI_Attribute_Create (&attrib, NULL);
0 REPLIES 0
Learn and get certified!