Replies: 1 comment 1 reply
-
I think your question is about "selecting a geometry object as an input feature", rather than building the array. The array (of geometry objects) should build just fine. I don't know what you mean by "to javascript". As far as I can tell, the code snippet you posted is Python. In other words, not Java code. And certainly not "Javascript", which is something else entirely. Usually, I have model.java.component("comp1").geom("geom1").create("arr1", "Array");
model.java.component("comp1").geom("geom1").feature("arr1").active(False);
model.java.component("comp1").geom("geom1").feature("arr1").set("fullsize", ["1", "S_int"]);
model.java.component("comp1").geom("geom1").feature("arr1").set("displ", ["0", "-S_s"]);
model.java.component("comp1").geom("geom1").feature("arr1").selection("input").set("r2"); It looks like you assigned Maybe you're looking for a way to make the Python code more "pythonic" (i.e., less "Java-like"). Then you'd want to call
So if that's what you want, it's simply not implemented. But, as the documentation also notes, you can just do... what you're already doing, right? |
Beta Was this translation helpful? Give feedback.
-
To javascript for a given array seems to follow the format:
model.component("comp1").geom("geom1").create("arr1", "Array");
model.component("comp1").geom("geom1").feature("arr1").active(False);
model.component("comp1").geom("geom1").feature("arr1").set("fullsize", ["1", "S_int"]);
model.component("comp1").geom("geom1").feature("arr1").set("displ", ["0", "-S_s"]);
model.component("comp1").geom("geom1").feature("arr1").selection("input").set("r2");
I cant seem to figure out the MPh equivalent for:
model.component("comp1").geom("geom1").feature("arr2").selection("input").set("r2");
I had assumed the MPh equivalent code would be:
array_1 = geometry.create('Array', name = 'array_1')
array_1.set('input', 'thing to array')
array_1.property('fullsize', ['1', 'S_int'])
array_1.property('displ', ['0', 'S_s'])
or array_1.property('input', 'thing to array')
Neither seem to work. Maybe I am missing something obvious?
Beta Was this translation helpful? Give feedback.
All reactions