Nov
07

coordinates

If the tower you’re designing is super curvy and if none of your floor plates are shaped the same, it becomes really hard to transfer the geometry into construction. One of the most basic information that the builders need is coordinates from different areas of the building. The more organic the design, the more points you’ll have to provide them in order for the actual structure to come close to what you designed. aka. This can take forever.

So here’s a little script that will do this for you. This is actually the first rhinoscript I wrote :P  First it’ll ask you to choose a base point. The coordinates of the other points will be calculated using the base point as (0,0,0).

BasePointCoordinates

Sub CoordinatesBasePoint

Dim baseObject
baseObject = Rhino.GetPoint(“Select base point to be set as (0,0,0)”)
If IsNull(baseObject) Then Exit Sub

Dim arrObjects
arrObjects = Rhino.GetObjects(“Select points to calculate coordinates”, 1, True, True)
If Not IsArray(arrObjects) Then Exit Sub

Dim arrPoint0, arrVector, arrPoint3
arrPoint0 = Array(0,0,0)
arrVector = Rhino.VectorCreate(baseObject, arrPoint0)

Dim strObject, arrPoint, arrPoint2
For Each strObject In arrObjects
arrPoint = Rhino.PointCoordinates(strObject)
arrPoint2 = Rhino.PointSubtract(arrPoint, arrVector)
Rhino.AddTextDot Rhino.Pt2Str(arrPoint2, 3), arrPoint
Next

End Sub

CoordinatesBasePoint

Add your comment

2 responses for this post

  1. kim sung jin Says:

    point별로 name을 설정하고 엑셀프로그램으로 좌표값을 전환하는 스크립트도 가능하신가요?. 답변부탁드립니다.

  2. crtl-i Says:

    몰론 가능하죠 :)

Leave a Reply