Grasshopper

algorithmic modeling for Rhino

Hi all

Im working on an a project where I will need to export a collection of curves as separate illustrator files(.ai)

I have attached a example file which has all the elements that i will use in the file, the problems that i have encountered are in the VB component

As some of you may notice i have incorporated the example posted up by Marc Hoppermann, which was tweaked by Damien Alomar.

I think what essentially is happening is that the curves are being overwritten and only the last curve is being exported properly. This is a bit strange as i have played around with the script before to export different file types and it had worked fine.

Hopefully the mistake im making is pretty simple , so if anyone could help that would be much appreciated.

Thanks also Vicente Soler, who gave me some help on the data tree part of this file.

Cheers

Louis

Views: 579

Attachments:

Replies to This Discussion

Its just a problem of how you handle data trees.

Flatten your input to curves, and check 'list' on your filename input. The exporting needs to happen within the loop, since you need 6 different files. So I tweaked your code a bit:

Private Sub RunScript(ByVal curves As List(Of OnCurve), ByVal sFileName As List(Of String), ByVal blnSave As Boolean, ByRef A As Object)
'////// Marc Hoppermann ///////////...tweaked by Damien Alomar
If blnSave Then
doc.UnselectAll
For i As Integer = 0 To curves.Count - 1
Dim mCurveObj As New MRhinoCurveObject
mCurveObj = doc.AddCurveObject(curves(i))
mCurveObj.Select()
app.RunScript("_-export " & sFileName.Item(i) & " _Enter")
app.RunScript("_delete")
Next
End If

End Sub
thanks guys, i ll look into your replies today ...cheers
My guess is that you incorrectly placed the last graft component after the polyline component when it should be placed after the expression component. If you do that switch it should work fine.
that would work too... but then you wouldn't really need a for loop.
thanks guys, i ll look into your replies today ...cheers

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service