cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How can I change the Material and Units

CHASEONHO
18-Opal

How can I change the Material and Units

Hello
How can I specify the material and unit of the model?
Using the toolkit!image 1.png

1 ACCEPTED SOLUTION

Accepted Solutions

status = ProMaterialfileRead((ProPart)mdl,matl_name);

matl_name should be name of material file...Not the path of material file...

You can traverse to material directory by changing directory using API ProDirectoryChange() .After setting material, you can reset directory as earlier working directory. 

View solution in original post

7 REPLIES 7

There is direct API for material and units.. Are you looking for API itself or you have some specific concern or issue for this functionality?

What APIs do they perform?
Can you find information on related examples?
It is difficult to search in the API itself and to use the API in which functions.
It is difficult to be sure that the API is the feature I'm looking for, but it does search using protkdoc's html.
thank

Give a try for below :

 

1. For Material : protkdoc/samples/UgMaterial_c.html#anchor-29

2. For Unit : /protkdoc/samples/UgMaterial_c.html#anchor-29

 

HIH

-Ketan

I tried the following to change the material, but there is a problem.
It seems unfamiliar to use ProMaterialfileRead..

	ProError status;
	ProMdl mdl;
	ProName matl_name;
//////////////////////////////////////////////////////////
	ProMdlCurrentGet(&mdl);
	ProStringToWstring(matl_name,(char*)"C:\\test");
	status = ProMaterialfileRead((ProPart)mdl,matl_name);
//////////////////////////////////////////////////////

I've tried the above code, but I get an error.
Can you help me?

status = ProMaterialfileRead((ProPart)mdl,matl_name);

matl_name should be name of material file...Not the path of material file...

You can traverse to material directory by changing directory using API ProDirectoryChange() .After setting material, you can reset directory as earlier working directory. 

@Ketan_Lalcheta

The material file is read, but no material is specified.
Could you tell me what I need to do to designate the material please?

image 2.png

I knew how to specify the model.
Using ProMaterial, we have declared the model to be materialized and the registered material.
We then used ProMaterialCurrentSet to successfully assign the material to the model.
Can you run Mass Properties in the toolkit?image 3.png

Top Tags