Skip to content

Instantly share code, notes, and snippets.

View ufaoleg's full-sized avatar

Oleg ufaoleg

  • PRSPKT architects
  • Ufa
View GitHub Profile
@ufaoleg
ufaoleg / hou group split.py
Last active November 6, 2018 04:11
Houdini split group from alembic to obj
import hou
import random
color1 = hou.Color((0.0, 0.0, 0.0)) # black
color2 = hou.Color((1.0, 0.0, 0.0)) # red
color3 = hou.Color((0.2, 0.2, 0.2)) # gray
node = hou.selectedNodes()[0]
geo_node_path = "/obj/" + str(node.parent())
geo_node = hou.node(geo_node_path)
using System;
public class Test
{
public static void Main()
{
Console.WriteLine(ConvertToRanges("1,2,3,4,8,9,10,15"));
Console.WriteLine(ConvertToRanges("5,6,7,9,10,11,12,15,16"));
}
@ufaoleg
ufaoleg / Hou_Join.cc
Created March 18, 2018 19:42
Attribute wrangle
// FUNCTIONS
void removedups(int pts[])
{
int end=len(pts);
int ct1=0, ct2;
while(ct1<end)
{
ct2=ct1+1;
while(ct2<end)
{
public void groupAudit()
{
Document doc = this.ActiveUIDocument.Document;
List<Group> groups = new FilteredElementCollector(doc).OfClass(typeof(Group)).Cast<Group>().ToList();
List<GroupType> groupTypes = new FilteredElementCollector(doc).OfClass(typeof(GroupType)).Cast<GroupType>().ToList();
List<Tuple<string, int, int>> groupData = new List<Tuple<string, int, int>>();
// using (StreamWriter sw = new StreamWriter(@"C:\Users\harry_000\Desktop\RTC_EUR_2015-2015-10-28\RTC EUR 2015\Advanced API\\output.txt"))
public void topoFromSdrFile()
{
Document doc = this.ActiveUIDocument.Document;
List<XYZ> points = new List<XYZ>();
using (StreamReader sr = new StreamReader(@"C:\Users\harry_000\Desktop\USPS-Eville.sdr"))
{
string line = "";
while ((line = sr.ReadLine()) != null)
{
if (line.Contains("-") || line.Contains(":"))