PolylineFromSelection and getAffectedObjects

Hi there. I’m converting some user selections to Polyline with

var di = getDocumentInterface();
PolylineFromSelection.autoJoinSegments(di, 0.001);

And I want to get the newly created polylines.
Normally I’d..

var op = new RSomeOperation(...);
var transaction = operation.applyOperation(...)
var ids = transaction.getAffectedObjects();

But I don’t know what type of op it is or how to access it’s arguments (undocumented pro cmd as I understand it, though I’m running pro).
Everything I’ve tried so far has failed.
Can someone give me a quick example of how to get a handle to the results of this sort of command?
Thank you!

Similar Topic:

from what I understand that with a selection and a specified document interface:
var Counter = PolylineFromSelection.autoJoinSegments(di, 0.001);
simply would create the polys from the selection in the di and returns how much that are created.

So, probably the op is part of the method. :wink:

Andrew’s note:
Please keep in mind that PolylineFromSelection is not part of the public API but part of the proprietary API of QCAD Professional.
Feel free to call this from your script, but keep in mind that this API might change in a future version.

Regards,
CVH

The function signature is:

/**
 * Creates polyline(s) from selected entities in di using given tolerance.
 *
 * \param di RDocumentInterface
 * \param tolerance Tolerance
 * \param action RAction (usually caller or this)
 * \param useTransactionGroup True to add operations to current transaction group
 * \param selectResult Select resulting polylines
 *
 * \return Number of polylines created.
 */
PolylineFromSelection.autoJoinSegments = function(di, tolerance, action, useTransactionGroup, selectResult) { ... }

You can use:

PolylineFromSelection.autoJoinSegments(di, tolerance, undefined, false, true);

This will select the new polylines after they are created, so you can query them as the current selection.

excellent! Thank you!