Script for X,Y,Z coordinates?
All  1-9  10-15

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
7457.10 In reply to 7457.9 
Thanks Brian!

Michael T.
Michael Tuttle a.k.a. mictu http://www.coroflot.com/DesignsByTuttle
  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:  BurrMan
7457.11 In reply to 7457.10 
Here is a script Michael wrote awhile back that gets things on the clipboard.... Maybe someone wants to modify it to output with an html label or something....

code:
 code:// Gather up a list of the x,y,z coordinates of point objects and endpoints of
// curves and copy the list as text to the clipboard.

var str = '';

function AddNumber( num )
{
	// Use 6 decimal places.
	str = str + num.toFixed(6);
}

function AddCoordinate( pt )
{
	AddNumber( pt.x, str );
	str = str + ",";
	AddNumber( pt.y, str );
	str = str + ",";
	AddNumber( pt.z, str );
	str = str + "\r\n";
}

var pts = moi.geometryDatabase.getSelectedObjects().getPoints();
for ( var i = 0; i < pts.length; ++i )
{
	var ptobj = pts.item(i);
	AddCoordinate( ptobj.pt );
}

var crvs = moi.geometryDatabase.getSelectedObjects().getCurves();
for ( var i = 0; i < crvs.length; ++i )
{
	var crv = crvs.item(i);
	AddCoordinate( crv.getStartPt() );
	AddCoordinate( crv.getEndPt() );
}

moi.copyTextToClipboard( str );

EDITED: 20 Jun 2015 by BURRMAN

  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:  Frenchy Pilou (PILOU)
7457.12 
No more developpment ? :)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  bemfarmer
7457.13 In reply to 7457.12 
Here is an update for PointCoordinates script.

It was necessary to search for Snap documentation. The .js has two links to forum posts which proved helpful.

The state of the ObjectSnap button, and the button's SnapPt checkbox are saved, then they are both turned on or left on.
After one point is selected, they are both restored to their initial state.
(If the Cancel button is pushed before selecting the point, both are left active, which may not be their initial state, and the script terminates.)

After selecting a point, the script displays an alert of the x, y, z coordinates, hard coded to 6 decimal points.

Selecting in 3D view should help avoid confusion of points on top of each other in the other views.

- Brian

EDITED: 10 Mar 2016 by BEMFARMER


  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:  bemfarmer
7457.14 In reply to 7457.13 
Added in part of Michael's code for placing the coordinates in the clipboard.
Max's z88 program uses the clipboard.
Added parseFloat to remove trailing decimal zero's.

This script only does one point, which suits my current project for pasting to excel, but
perhaps the ability to add multiple points should be added.

- B

  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:  Franz
7457.15 In reply to 7457.14 
Thanks, its very useful !
Franz
  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

 

 
 
Show messages: All  1-9  10-15