Hi Marco,
> The problem is that the line "output.addObject(subObjs.item(i2));" seems to add an
> incompatible object to the output ObjectList.
Could you be more specific about the problem - does that line trigger an exception with an error message being displayed? If so, please show the message.
When you say "incompatible" what are you referring to - incompatible to what specifically? What is it that you're trying to do with the object list that you have gathered the segments into?
If it's to run as an input to a geometry factory then yes that is not likely to work because commands are expecting to receive curve objects and not the lower level curve segments.
But I think one way you could convert curve segments into independent curve is using the Edit > Separate command, see Separate.js for an example. I forget what happens if you run separate on a single segment curve, if it skips those then you would need to use crv.clone() on single segment curves instead.
- Michael
|