Archive for category programming

On the door handiness in Autodesk Revit

I was working on semi – automated solution to enter door handiness in Revit models. The existing solutions are either quite expensive (like Reforma Swing Direction) or has weird assumptions.

My intial setup is Dynamo and the Dynamo Door Set Handing module from http://archi-lab.net/. It has fine tutorials, so you only need to create your model in Dynamo.

The weird thing on door handines is it is different in some countries.

  • Door handiness in Germany is defined as hinge position on the door, when one is pulling the door to open. if the hinges are on the left side, the door is left-handed, and if the hinges are on the right side, the door is right-handed. I will refer it ad “DIN – style”.
  • The IFC, together with ISO 16739 defines door handiness as the position of “positive Y axis”, which is definitelly the position of door handle when puling.  I will refer it as “ISO – style”.
  • Americans use ISO style, but also has “reversed” option. I still have no idea on this option, as “reversed right” is “left”.

So, what’s to do?

Read the rest of this entry »

Tags: , , ,

Revit and IronPython: the early bird

ODS module does not work on IronPython, and i don’t know the way to add Revit modules to regular Python.Whatever …

''' cut-n-paste from the net
 @author: ejs
 '''
 import clr
 import sys
 clr.AddReference('RevitAPI')
 clr.AddReference('RevitAPIUI')
 from Autodesk.Revit.DB import *
 from Autodesk.Revit.DB.Architecture import *
 from Autodesk.Revit.DB.Analysis import *
 
 #sys.path.append(r'C:\Python\3.4\Lib\site-packages')
 
 #from odslib import ODS
 
 #ods = ODS()
 
 uidoc = __revit__.ActiveUIDocument
 doc = __revit__.ActiveUIDocument.Document
 
 cView = uidoc.ActiveView
 
 collector = FilteredElementCollector(doc)
 collector = FilteredElementCollector(doc).OfClass(ViewSchedule);
 
elems=collector.ToElements()
 n_elems=len(elems)
 
 for elem in elems:
     if cView.Id == elem.Id: Read the rest of this entry »

Search engine providers for Firefox and MS IE

I’m lazy person.
Here are search engine providers for Firefox and MS IE web browsers.

I’ve added keywords for these search engines, like evt for Evita.lt, lmn for lemona.lt. Now, searching in particular site is as easy as Lotus 1-2-3: type in keyword and the term you need to search in the address bar. So, typing lmn ds180 will search for ds180 in Lemona.lt site.

Firefox Lemona.lt Evita.lt Datasheetcatalog.com
MS IE Lemona.lt Evita.lt Datasheetcatalog.com

Cheers.

Just for fun / ᛃᚡᛊᛏ᛫ᚠᚮᚱ᛫ᚠᚡᚾ

I’m glad to present a small webapp, converting entered text to probably Elder FUTHARK. No spell checking is performed, some rune combinations are ommited, but it may still be funny.

ᛁᛗ᛫ᚷᛚᚨᛑ᛫ᛏᚮ᛫ᛈᚱᛂᛊᛂᚾᛏ᛫ᚨ᛫ᛊᛗᚨᛚᛚ᛫ᚹᛂᛒᚨᛈᛈ᛬ᛍᚰᚡᛂᚱᛏᛁᛝ᛫ᛂᚾᛏᛂᚱᛂᛑ᛫ᛏᛂᛪᛏ᛫ᛏᚮ᛫ᛈᚱᚮᛒᚨᛒᛚᚤ᛫ᛂᛚᛑᛂᚱ᛫ᚠᚡᚦᚨᚱᚲ᛭ᚾᚮ᛫ᛊᛈᛂᛚᛚ᛫ᛍᚻᛂᛍᚲᛁᛝ᛫ᛁᛊ᛫ᛈᛂᚱᚠᚮᚱᛗᛂᛑ᛬ᛊᚮᛗᛂ᛫ᚱᚡᚾᛂ᛫ᛍᚮᛗᛒᛁᚾᚨᛏᛁᚰᛊ᛫ᚨᚱᛂ᛫ᚮᛗᛗᛁᛏᛂᛑ᛬ᛒᚡᛏ᛫ᛁᛏ᛫ᛗᚨᚤ᛫ᛊᛏᛁᛚᛚ᛫ᛒᛂ᛫ᚠᚡᚾᚾᚤ᛭

OpenOffice.org, x64 and .NET interface

Here,’s the story short:

I need to create a series of graph for highly scientific data sets. The data is calculated in MatLAB, but the export of figures in MatLAB is a pain for me.

On the other hand OpenOffice.org seems to be the right tool for the job. The latest MatLAB has the function, called ‘xlswrite’. Happy with the fact, hoping it should write the XLS file I fire it up and…

Ouch. One must have Excell installed, as the data export goes through the ActiveX. If no Excell is found, the data is exported into CSV file, overwriting the file every time. Not the Right Thing. Read the rest of this entry »

Tags: , ,

Migration hell: moving printers in Windows

Our campus, Faculty of Architecture, VGTU is moving to the totally new subnet. As we use DHCP for IP distribution, no real problems except `sed` are going to appear.
The pleasing moment is we are getting a fresh IP range.
The headache is TCP/IP printers.

WPKG has good printer addition/ installation guide in http://wpkg.org/Printer_configuration , but it does not cover changing IP port numbers.
As a CEO on all computer infrastructure, I need to find any solution to make the movement smoothly.

I was unable to find a ready-made solution, and in-house tool appeared after several hours in the Net.
I need to apologize for bugs and errors, as it is the first (and hopefully the last) VB script. It uses WMI. Testing box was W7, x64.
Maybe someone will find it useful.

Call the file chprinterport.vbs Read the rest of this entry »

Weekend project – USBasp

I had some ideas to go out before, but as i got terrible cold last Friday, I had to postpone all of them.

I feel a bit better today, so decided to build USBasp – an USB port ISP programmer for Atmel product family. I used STK 200/300 dongle before, but it works from parallel port only.
USBasp: fresh PCB
Lets start: the schematics is from http://www.fischl.de/usbasp/ . You can find some schematics and pre-routed PCB’s there.

What I need is USB B type or MiniUSB connector, SMD parts, small footprint, single – sided PCB. The one I liked is by Thomas Pfeifer, http://thomaspfeifer.net/atmel_usb_programmer.htm. The problem is I found no files for Eagle there and had to re-create the PCB.

Additional features are:

  • RC filters on MOSI, MISO and SCK lines to suppress ringing, as suggested in AVR Freaks forum;
  • Signal from oscillator (XTAL1) is routed to the pin 3 on IDC connector via jumper – a handy feature to debrick the MCU if you accidentally fused external oscillator;
  • Inductor on the power line.

The PDF files with the layout are here, an A6 – size mirrored image for direct printing on OHP is here.

Added on 2008-10-01:
USBasp top side, populated
USBasp bottom side, populated
First, it works. Both connected directly or via USB hub.
Second: don’t create anything while you are ill. Actually, pin number 5 on miniUSB connector MUST be grounded, while pin number 4 can be grounded or left floating. I’ve used i jumper wire to solve the issue.

Tags: , ,

Colorization

505510

Quite interesting article on image processing. The MatLAB source, presented on the site, need some minor enhancments. Authors may contact me, if they want ;).
Attention: the program is really slow. I used ‘direct solver’, and it took almost 10 minutes to proceed the image.

JPEG-2000 in MatLAB

Any idea how to produce and read the JP2 file in MatLAB?
The easiest way should be writing middleware in Java to specific library. The things are complicated, as i need to get and modify data from every stage of encoding/decoding, like color space transformations, quantization, EBCOT (including bit-plane decomposition, bit-plane processing, encoding) and rate-encoders. Read the rest of this entry »