Example #1
0
 /// <summary>
 /// Returns the path to the open worksession .rws file.
 /// If null is returned, then either there is no worksession .rws file open,
 /// or the active worksession has not yet been saved.
 /// </summary>
 /// <param name="serialno">The worksession's runtime serial number.</param>
 /// <returns>The path to the open worksession .rws file if successful, null otherwise.</returns>
 public static string FileName(uint serialno)
 {
     using (var holder = new OnString())
     {
         var ptr_holder = holder.NonConstPointer();
         var rc         = UnsafeNativeMethods.CRhinoWorkSession_FileName(serialno, ptr_holder);
         return(rc ? holder.ToString() : null);
     }
 }
Example #2
0
        public string[] ToArray()
        {
            var count = Count;

            if (count < 1)
            {
                return(new string[0]); // MSDN guidelines prefer empty arrays
            }
            var rc = new string[count];

            using (var holder = new OnString())
            {
                var ptr_holder = holder.NonConstPointer();
                for (var i = 0; i < count; i++)
                {
                    UnsafeNativeMethods.ArrayString_Get(m_ptr, i, ptr_holder);
                    rc[i] = holder.ToString();
                }
            }
            return(rc);
        }