Skip to main content
kbar
Inspiring
May 25, 2016
Answered

getByName & random character issue (Root.204ba79a45804da02860)

  • May 25, 2016
  • 1 reply
  • 1007 views

Hi there,

I have a PRC file in my PDF.

In the tree view in Acrobat it shows the names of the objects correctly.

If I list them using JavaScript into the console then it gives me the name plus a load of characters. This makes it impossible to reference the nodes or meshes in the scene.

This is the javascript code...

for (var i=0; i < scene.nodes.count; i++)

{

     console.println(scene.nodes.getByIndex(i).name);

}

And this is the output

Root.204ba79a45804da02860

Camera.204ba79a45804da02808

Sphere.204ba79a45804da02830

Sphere Model.204ba79a45807b5030204ba79a45804da02830

Cube.204ba79a45804da02858

Cube Model.204ba79a45807b5080204ba79a45804da02858

I am using Adobe Acrobat Pro DC version 15.016.20041.55549.

Does anyone know what these additional characters are?

Since due to these random characters it makes it impossible to use getByName.

IE scene.nodes.getByName("Sphere"); does not return a valid node.

Thanks,

Kent

This topic has been closed for replies.
Correct answer JoelGeraci_Datalogics

I've handled this in the past by creating a function that iterates through the nodes looking for the substring up to the period and then returning that node. It can be slow on large models but it does work.

J-

1 reply

JoelGeraci_Datalogics
JoelGeraci_DatalogicsCorrect answer
Participating Frequently
May 25, 2016

I've handled this in the past by creating a function that iterates through the nodes looking for the substring up to the period and then returning that node. It can be slow on large models but it does work.

J-

kbar
kbarAuthor
Inspiring
May 25, 2016

Thanks Joel, I thought that might end up being the case.

I will create a lookup table instead I think. Parse all the nodes and meshes and strip everything after the period, then store that name with an index to its position in the original lists. That way I won't need to parse all the nodes each time I am search for a single one.

What would be great in future is if the UniqueID that is applied to ProductOccurances in the PRC file could be automatically assigned to the SceneObject.objectID variable.