Design Pattern for Scripting with Nodes and CSV-Input

Next
 From:  goetzmoritz
9709.1 
Hi there,

I've built up a node system for generating an object and parametrize it by settings height, width and depth as const-inputs. So far so good!

Now I want to use a CSV which contains a lot of those objects and want to generate output-files (step and OBJ) programmatically and my question is just what the preferred way would be to solve that with MOI?
The csv contains also columns for height, width and depth next to other information that are needed in different process steps.

I'd think to iterate through the csv with python and then call the object each time. But then I don't know how to open the nodes from python, alter the values, commit that and create the new geometry. Also there is a csv-import inside of MOI which could probably do that job, too?

Thanks for your help!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9709.2 In reply to 9709.1 
Hi moritz, it is possible for a MoI script to open and read lines from text files.

For an example check out this script:
http://kyticka.webzdarma.cz/3d/moi/#ImportPointFile

Find the one that says that it was updated to also work on Mac, that's the one that uses the newer MoI text file reading for scripting.

Also some description here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9665.2

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Message 9709.3 deleted 3 Mar 2020 by BEMFARMER

Previous
Next
 From:  goetzmoritz
9709.4 In reply to 9709.2 
Hi Michael,

thank you very much for your quick answer.
I think that reading of the file is an issue I'd probably be able to tackle with your links.
But what about the nodeeditor? Is it possible to somehow select the nodes I created "by name" or something like that, edit the values and than create a new object by that?

Thanks!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9709.5 In reply to 9709.4 
Hi moritz,

re:
> But what about the nodeeditor? Is it possible to somehow select the nodes I created "by name" or
> something like that, edit the values and than create a new object by that?

So you mean you want to access the nodeeditor through script to feed it values from the .csv file?

I would think it should be possible but I'm sorry I don't know enough details about the nodeeditor to know how to do that.

You would probably put your .csv reading code into the node editor dialog page (index.html file inside the node editor directory), and then the node editor object will be on there as a global variable and I'd think it would have arrays of nodes inside of it.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Karsten (KMRQUS)
9709.6 In reply to 9709.1 
Hello Moritz,
it ispossible to read csv-files with the nodeeditor. There is a node in the extensions under import. Can you post an example and explain something more detail - then I can have a look.

Have a nice weekend
Karsten
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All