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

How can I change the Material and Units

SOLVED
CHASEONHO
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

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I change the Material and Units

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

Re: How can I change the Material and Units

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?

Re: How can I change the Material and Units

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

Re: How can I change the Material and Units

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

Re: How can I change the Material and Units

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?

Re: How can I change the Material and Units

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

Re: How can I change the Material and Units

@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

Re: How can I change the Material and Units

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

Announcements