Cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the color of objects in the 3-D model?

Genius
Genius

Hello, everyone! I create a model, as is shown in the following attachment. Here is my problem: the parts can change its color in the 2-D model , but the parts cannot change its color synchronously in the 3-D model. What should I do to come true the change of color in 3-D model? Any help is great appreciated!

4 REPLIES 4

Re: How to change the color of objects in the 3-D model?

Phenom
Phenom
to individually Change the Color of 3d objects, have a look at _3d.activateMaterialWithColor

You're Methode code should look something like this

if @.io=true
@.curricon:="green"
@._3d.activateMaterialWithColor(makeRGBValue(0,255,0));

return 1
else
@.curricon:="red"
@._3d.activateMaterialWithColor(makeRGBValue(255,0,0));

return 2
end


Highlighted

Re: How to change the color of objects in the 3-D model?

Siemens Phenom Siemens Phenom
Siemens Phenom

... or you change the object material:

@._3D.MaterialActive := true (after once done for an MU, this does not need to be done anymore)
@._3D.MaterialDiffuseColor := makeRGBValue(255,0,0)

 

(this protects graphic inheritance)

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: How to change the color of objects in the 3-D model?

Genius
Genius

Hi,sir!

 firstly ,I express my great appreciation to your quick reply .Refering to your new ideas ,i  modify the method as following because the version is 13.1,then the model can works.


if @.io=true
@.curricon:="green"

 

@._3d.materialactive:=true
@._3d.materialambientcolor:=makergbvalue(0,255,0)
@._3d.materialdiffusecolor:=makergbvalue(0,255,0)
@._3d.materialemissivecolor:=makergbvalue(0,255,0)


return 1
else
@.curricon:="red"

@._3d.materialactive:=true
@._3d.materialambientcolor:=makergbvalue(255,0,0)
@._3d.materialdiffusecolor:=makergbvalue(255,0,0)
@._3d.materialemissivecolor:=makergbvalue(255,0,0)

 


return 2
end

 

Have a great time!

Re: How to change the color of objects in the 3-D model?

Genius
Genius

Hi, Mr.Peter!

 

Your answer is what I want to achieve!  I just resolved this problem several minutes ago, though i Thanks for your feedback !

Have a good time !