The problem with the double quotes which might need explanation is two
fold:

First, like I said before, some (and most on PCs) files don't support
quotation marks, or other random characters in their file names such
as /, *, ", etc... Another similar programming phenomenon is a space.
Take for example when you go to a web page or image that has spaces in
the file name, these spaces are replaced by an ampersand (&) or a plus
sign (+) in order for the browser to read your file.

Second, ASCII characters (which is what the "Char(34)" referred to)
are from the American Standard Code for Information Interchange.
Basically, each character has an ASCII value assigned to it which you
can refer to in most programming languages and the computer will
understand it as the character it's referencing (built in variable
definitions if you will).  When we're trying to print something such
as a file name, in order to use symbols which the programming language
uses to differentiate other things such as comments, we can use the
ASCII value so that it doesn't get confused as to what we're trying to
output.  You can look up the ASCII table online and see that the
printable characters start at 32 and work their way up, the quotation
happens to be the second on the list giving it the ASCII character
code 34.

Hope this helps with some of your scripting questions!

On May 8, 9:02 am, Patrick <pbed...@gmail.com> wrote:
> taz
>
> but your doin well ;]
>
> I tried out the changes you told me:
>
> The double quotes symbol is represented by
> the variable Chr(34) so removing them solves the problem.  For
> example:
> Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
>
> You are a genius taz! Thanks a lot man thats great. But for
> understanding the problem can you explain about theese double quotes?
> I'm hardly getting behind this scripting chinese until I forced myself
> to learn the vocabs.
>
> pat
>
> On 7 Mai, 22:19, taz <tzez...@gmail.com> wrote:
>
> > Patrick,
>
> > It's hard work pretending to be Damien.
>
> > Anyway, I played around with the script and I got it to work so here's
> > a couple things to note:
>
> > _The VB component updates with GH events (unless you disable the
> > setting under Solutions).  Updating with GH events is what you want
> > when you are rendering out the animation (as the slider ticks along),
> > but before that any changes you make in GH will also cause a render to
> > occur.
>
> > _It may help you to set the x variable hint type to OnBrep as a
> > reminder.  The script is only setup to render a single BRep object.
>
> > _Elizabeth was right.  The extra double quotes in my .jpg file name
> > wont allow the file save.  The double quotes symbol is represented by
> > the variable Chr(34) so removing them solves the problem.  For
> > example:
>
> > Dim filename As String = "C:\GH_Animation\frame" & y & ".jpg"
>
> > -taz
>
> > On May 7, 5:53 am, Patrick <pbed...@gmail.com> wrote:
>
> > > taz,
>
> > > I tried different things: changing file types like png, jpg or bmp. (I
> > > have to mention that I count myself completely to the script virgins)
> > > I just inserted the code from Damien into a VB comp. If I connect an
> > > object (i.e. geometry inside a bounding box) to the x input rhino
> > > immediately starts to render an image. If I then connect a number
> > > slider (which is also rotating the bbox geo) into the y input of the
> > > VB comp it does the same thing again. For an animation from stills I
> > > just need to animate the slider in a usual way and GH starts to
> > > extract stills from slider positions and synchroniusly tells rhino to
> > > render the scene in vray.
>
> > > It all seems to work well but the destination folder remains empty!
>
> > > On 7 Mai, 09:23, taz <tzez...@gmail.com> wrote:
>
> > > > Patrick,
>
> > > > From the code it looks like your slider should be attached to a
> > > > variable named "y" and the output to your destination folder (on your
> > > > D:\ drive in a folder named GH_Animation) should be a .bmp.
>
> > > > Is that what you have for a setup?
>
> > > > -taz
>
> > > > On May 6, 11:42 am, Patrick <pbed...@gmail.com> wrote:
>
> > > > > He guys
>
> > > > > for animation purposes I tried out a small VB script from Damien
>
> > > > >  Dim obj As IRhinoBrepObject = doc.AddBrepObject(x)
> > > > >     doc.Regen()
>
> > > > >     Dim filename As String = "D:\GH_Animation\frame" & Chr(34) & y &
> > > > > Chr(34) & ".bmp"
>
> > > > >     app.RunScript("-_Render")
> > > > >     app.RunScript("-_SaveRenderWindowAs "& Chr(34) & filename & Chr
> > > > > (34) )
> > > > >     app.RunScript("-_CloseRenderWindow")
>
> > > > >     doc.DeleteObject(New MRhinoObjRef(obj), True, True)
>
> > > > > I made it that Rhino is obviously rendering all images choosen from an
> > > > > animated slider connected to the component. It shows me "Image
> > > > > successfully saved as D:\GH_Animation\frame"4".jpg" in the command
> > > > > line but the destination folder remains empty!
>
> > > > > Can you help Damien?

Reply via email to