Skip to main content
Participant
January 15, 2017
Answered

why addModel(model.u3d) doesn t work ?

  • January 15, 2017
  • 1 reply
  • 823 views

Hello,

I have create an sample 3d pdf then i attach a u3d file as resource to pdf level.

I create a button :

c3d = getAnnots3D(0)[0].context3D;

var ressource = new c3d.Resource("pdf://one.u3d");

c3d.scene.addModel(ressource);

c3d.scene.update();

I don t know why it doesn t work.

return :

Line: 0: Code: 1(0x1): addModel

GeneralError: L'opération a échoué.

ScriptProxy.(null):3:Field import_number:Mouse Down

Line: 0: Code: 1(0x1): addModel

what do i wrong ?

Thanks in advance...

link to pdf sample :

test.pdf - Google Drive

link to u3d resource :

one.u3d - Google Drive

Correct answer gta974

The solution is to call the addModel() method inside the context3D.

1 reply

gta974AuthorCorrect answer
Participant
January 16, 2017

The solution is to call the addModel() method inside the context3D.

Participant
August 14, 2025

Goodday.

Can you help me with a full script example?

Thank you

Merci et bonne journée

Cmo