Boat Design Forums  |  Boat Design Directory  |  Boat Design Gallery  |  Boat Design Book Store  |  Thanks to Our Site Sponsors

Go Back   Boat Design Forums > Design > Software
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-04-2009, 12:26 AM
jamesflett jamesflett is offline
Mech Engineer
 
Join Date: Jun 2006
Rep: 32 Posts: 40
Location: New Zealand
Export Rhino Data to Excel...

Hello all, I will cut to the chase.

Is it possible to export surface/solid data from Rhino and link/embed it into MS Excel or vice versa???

Essentially, I would like to be able to export specific dimensions and data such as surface areas and volumes of shapes from Rhino directly into Excel. The reason for this is that I can then run my hydrodynamics program that I have written in Excel without measuring every volume and surface area. Ideally if anyone has ideas on how to run a macro within Rhino to update my Excel inputs OR a macro in Excel to retrieve this data. I assume the latter would be difficult as you would have to make sure that the same component is always selected before and after modification.

Surface areas are for determining my the lift and resistance generated and the volumes for stability/hydrostatics/weight study analysis.

I do have RhinoMarine, however the planing program is very airy fairy with regards to its analysis, and the hydrostatics is not particularly useful past the initial design stage.

I have driven Excel with Solidworks and vice versa back when I was at University so I know it most likely possible.

If anyone has any visual basic knowledge of Rhino in terms of extracting solid and surface data it would much appreciated.

Furthermore, if anyone wants to just drop ANY info on anything related to the above that would also be awesome.

Cheers in advance

Jim
Reply With Quote
  #2  
Old 09-04-2009, 05:27 AM
zeroname's Avatar
zeroname zeroname is offline
Naval Architect
 
Join Date: Oct 2008
Rep: 38 Posts: 195
Location: EArth
i dont know exactly any plugin can do it.. may be experts can tell u.. i only can tell u that both orca3d and rhinomarine can give u the results of calculation and data in MS excel directly.

thanks
Reply With Quote
  #3  
Old 09-05-2009, 07:08 AM
SEANT SEANT is offline
Junior Member
 
Join Date: Feb 2004
Rep: 34 Posts: 17
Location: Rhode Island
Here is a very basic Rhinoscript example of that type of Rhino/Excel connection. Run from the Rhinoscript editor

Code:
Option Explicit Sub ExtractProps2XL ' Declare variables Dim xlApp, xlBook, xlSheet ' Declare variable to hold the reference. Dim strObject Dim arrObjects Dim intCount Dim arrPoint 'Initialize count intCount = 0 ' Select some objects arrObjects = Rhino.GetObjects("Pick some (Poly)Surfaces for processing", 24) If Not IsArray(arrObjects) Then Exit Sub ' Open Excel object On Error Resume Next Set xlApp = GetObject(,"excel.application") If err Then Rhino.print "Excel not found. Operation aborted!" Exit Sub End If On Error GoTo 0 xlApp.Visible = True Set xlBook = xlApp.ActiveWorkbook Set xlSheet = xlBook.ActiveSheet 'Place titles on sheet xlApp.Cells(1,1).Value = "Mass Properties" xlApp.Cells(1,2).Value = "Object Identifier" xlApp.Cells(1,3).Value = "Surface Area" xlApp.Cells(1,4).Value = "Volume" 'Extract Properties of Surfaces For Each strObject In arrObjects If Rhino.IsObjectSolid(strObject) Then Rhino.ObjectName strObject, "Solid" & intCount xlApp.Cells(intCount + 2, 2).Value = Rhino.ObjectName(strObject) xlApp.Cells(intCount + 2, 3).Value = Rhino.SurfaceArea(strobject)(0) xlApp.Cells(intCount + 2, 4).Value = Rhino.SurfaceVolume(strobject)(0) End If intCount = intCount + 1 Next 'xlApp.Quit ' If closing excel is required Set xlApp = Nothing ' the application, then release the reference. End Sub ExtractProps2XL
Reply With Quote
  #4  
Old 09-05-2009, 03:01 PM
zeroname's Avatar
zeroname zeroname is offline
Naval Architect
 
Join Date: Oct 2008
Rep: 38 Posts: 195
Location: EArth
hy seant ,
thanks much.. after i run the script i get one error.
it says. Excel not found. Operation aborted!
though, i have microsoft office 2007 installed.
give a solution.
Thank
Reply With Quote
  #5  
Old 09-05-2009, 04:52 PM
SEANT SEANT is offline
Junior Member
 
Join Date: Feb 2004
Rep: 34 Posts: 17
Location: Rhode Island
The script will only attach to an open instance of Excel. Before running the script have Excel open with a blank worksheet active.

Also, the script has only been tested with Rhino 4 and Excel 2003.
Reply With Quote
  #6  
Old 09-06-2009, 01:18 PM
zeroname's Avatar
zeroname zeroname is offline
Naval Architect
 
Join Date: Oct 2008
Rep: 38 Posts: 195
Location: EArth
ok thanks much.. it also works with rhino 4 and excel 2007
Reply With Quote
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
2D Rhino to Autocad export and rhino sectioning fede Software 13 10-18-2009 02:55 AM
Problems with Rhino->NAPA Export File Christian_S Boat Design 4 04-01-2009 10:54 AM
rhino/righting arm data 3dig Software 7 05-03-2007 03:09 PM
rhino3d 2.0 ghs data export pavel915 Software 9 12-09-2006 10:29 AM
about Pro/E data export? Software 0 05-23-2002 09:22 PM


All times are GMT -5. The time now is 02:46 AM.


Powered by: vBulletin 3 Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Web Site Design and Content Copyright ©1999 - 2010 Boat Design Net