cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
sxs
Booster

How to get texture file

Hi,everyone:

 

	API_Component3D	mat = {};

	mat.header.typeID = API_UmatID;
	mat.header.index = iumat;//iumat is input
	
	//
	auto err = ACAPI_ModelAccess_GetComponent(&mat);
        if(err != NoError)
          return;
        //
	std::string texture_path;
	//
	{
		//
		GS::UniString texture_str;
		if (mat.umat.mater.texture.fileLoc)
		{
			err = mat.umat.mater.texture.fileLoc->ToPath(&texture_str);
			if (err == NoError)
			{
				texture_path = texture_str.ToCStr();
			}

			delete mat.umat.mater.texture.fileLoc;
			mat.umat.mater.texture.fileLoc = nullptr;
		}
		exporter->PrintLog("texture path ");
		exporter->PrintLog(texture_path);
		exporter->PrintLog("\n");
	}

  This is my code for getting texture,but the output texture path does not exist.

 

sxs_0-1749179467518.png

 

1 Solution

Accepted Solutions

Hi sxs,

 

I think this path means, that the file is in the embedded library of the project. It should be accessible if you use the path with file operations from the ACAPI. So you can e.g. copy it to another place in the filesystem to make it accessible with the Windows File Explorer.

 

Hope that helps,
Bernd

Automating Archicad with Add-Ons, GDL-Objects & Python Archi-XT.com

Go to post

3 Replies 3

Hi sxs,

 

I think this path means, that the file is in the embedded library of the project. It should be accessible if you use the path with file operations from the ACAPI. So you can e.g. copy it to another place in the filesystem to make it accessible with the Windows File Explorer.

 

Hope that helps,
Bernd

Automating Archicad with Add-Ons, GDL-Objects & Python Archi-XT.com
sxs
Booster

Ok,I got it.

sxs
Booster

Thank you.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!