Cancel
Showing results for 
Search instead for 
Did you mean: 

Copying a 3D graphic group

Valued Contributor
Valued Contributor

Hello, community.

Is there a way to  copy a 3D graphic group(s) from one object to another via simtalk?

 

If the answer is no, my issue is I would like to show a set number or text above a MU in 3D representation; is there a workaround if the copy method doesn't exist?

Thank you for your support.

Regards,

 

BD

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...
17 REPLIES

Re: Copying a 3D graphic group

Phenom
Phenom

have you checked ._3d.createText(....) to add a 3D text to your MU ?

 

Re: Copying a 3D graphic group

Siemens Phenom Siemens Phenom
Siemens Phenom

The idea with _3D.createText is good - however, I would prepare an animatable object for that in advance.

That way, you only switch off the graphic inheritance of that animatable object and not that of the whole MU. Especially if the graphics of the MU is rather complex, this is interesting.

 

Say, you have the animatable object "Tag" in your MU class and <mu> is your MU instance. Then you could write your tag about like this:

mu._3D.getObject("Tag").createText(....)

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

Re: Copying a 3D graphic group

Valued Contributor
Valued Contributor

I've tried the createText(...) and it's quite the solution, but the problem is that the textbox below the text is visible as a coloured rectangle. Is it somehow possible to set the background of the text transparent, not visible?

 

Furthermore, is there in general a way to copy a 3D graphic group from an object to another?

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...

Re: Copying a 3D graphic group

Phenom
Phenom

you can "set" a material to the text graphics ( select object and press ctrl 3 for properties )

 

Then you can set the object transparency- but this has also impact on the black text characters.

 

To copy a graphics group, select the group and copy & paste it.

 

Re: Copying a 3D graphic group

Valued Contributor
Valued Contributor

Thanks, but as you said, also the text itself is affected by transparency and it's not good.

 

Instead, about copying the graphics, I'd need a way using simtalk code to copy and paste groups, during simulation runs. I've tried saving the graphic in an external file and then importing it during the simulation (always via simtalk), but the program crashes, therefore it's not a viable solution.

 

BD

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...

Re: Copying a 3D graphic group

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello BD,

 

do you have the error message of your crash?

 

Thanks,

Peter

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

Re: Copying a 3D graphic group

Valued Contributor
Valued Contributor

Hello,

I've attached the error message. The save/import is done on a MU.

Regards,

 

BD

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...

Re: Copying a 3D graphic group

Phenom
Phenom
why do you have to copy a graphics group during simulation ?

Re: Copying a 3D graphic group

Valued Contributor
Valued Contributor

Because I have to dinamically change the appearence of an object (MU in this case) during the simulation; and I don't want this object to have all the possible configuration of apperance to be already on it (show/hide method), otherwise the object would be to big and heavy both in performance and occupied space.

 

Thus, I would like to copy graphics from a standard object only when and where I need.

99 little bugs in the code,
99 little bugs in the code.
Take one down, patch it around.
127 little bugs in the code...