vlig

SCRIPT coords.js - Polyline vertexes

Jun 29th, 2014
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. forEach(ThisDrawing.PickFirstSelectionSet, function(ent) {
  2. if (ent.EntityName != "AcDbPolyline") return;
  3. var vv = new VBArray(ThisDrawing.Utility.CreateSafeArrayFromVector(ent.Coordinates));
  4. var coords = vv.toArray();
  5. //echo(coords.length);
  6. for (i = 0; i<coords.length; i += 2)
  7. {
  8.   ThisDrawing.Utility.Prompt(coords[i] + "," + coords[i+1]);
  9. }
  10. })
  11. function echo(msg) {ThisDrawing.Utility.Prompt(msg);}
  12. function forEach(coll, fn) {for (var enu = new Enumerator(coll); !enu.atEnd(); enu.moveNext()) fn(enu.item());}
Advertisement
Add Comment
Please, Sign In to add comment