I am creating a script that draws walls from a list of XYZ coordinates and a list of pairs of indices to connect. I am trying to create a simple data node to get to my ends and I need a method in flexscript.
Context is provided below:
----
I can import my CSV in script, I can create the Pillars in script by leveraging the ability to set "up" on an object like this:
for (int index = 1; index <= coords.numRows; index++)
{
Array pH = [];
for (int coord = 1; coord <= 3; coord++)
{
pH.push(coords[index][coord]);
}
treenode currDiv = Object.create("People::Walls::Pillar").setLocation(pH[1],pH[2],pH[3]);
string pillarName = "Pillar"+index;
Object currPillar = currDiv;
currPillar.setProperty("Name",pillarName);
currDiv.up = Model.find("/Walls>visual/drawsurrogate");
}
Now I need to create a wall from the script. I intend for this to be a simple solution for any future users. I could draw a wall and copy the node, then modify its values - but that's roundabout.
So as far as I can tell I just need to create a simple data node with the correct structure. I can create a subnode using treenode.subnodes.assert(), but when I try to use treenode.dataType(7) (or any other number) on the resulting node, I get an "Unknown command dataType being called" error.
The best solution in my opinion would be if I can directly draw a wall using the indexed name of existing pillars. If that is possible, can someone please tell me how to create that node and where I would be able to look to find information about how to create that node?
Or am I going about this wrong? I understand flexscript at a beginner/intermediate level, but my knowledge of C++ is pretty limited so I am looking for a solution in flexscript.
(Note: I have a similar script working for A* dividers but it simply uses the object create for each one and then resets the X,Y,Z variable values for each end. That's not an option for walls unless I can directly make a wall with script, but I assume that the ability to do that would mean that I initially assign Pillars and wouldn't need to do a "create and move" sort of thing)