cancel
Showing results for 
Search instead for 
Did you mean: 

C# API: read out a color of an object

Experimenter
Experimenter

Does anybody know how you can read out a color from an Object?

I am able to set a color, but if I read out, I get an exception.

 

Excample:

TxObjectList objects = TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants(new TxTypeFilter(typeof(TxRobot)));

 

var color = ((TxRobot)objects[0]).Color.Color.Name;  //Doesn't work

3 REPLIES

Re: C# API: read out a color of an object

Siemens Phenom Siemens Phenom
Siemens Phenom

Indeed, it does not seem to work...

Re: C# API: read out a color of an object

PLM World Member Phenom PLM World Member Phenom
PLM World Member Phenom

many people check this function in process simulate.

 

all people see the error of the API code in process simulate.

(API doesn't safe the color of object)

 

can you fix the problem or create a PR for this?

 

thanks

Kind regards,

Benjamin Voelzke

Re: C# API: read out a color of an object

Siemens Phenom Siemens Phenom
Siemens Phenom

It is better if you contact Siemens hotline so that they open a PR to Core R&D.