From a DWG to a bill of material DWG'den metraja

2026 / 11  /  8 min read8 dakika

Every fabrication shop I have worked in has the same bottleneck, and it is never the machines. It is the hour or two an engineer spends with a drawing and a spreadsheet, counting profiles, adding up metres of tube, estimating how many bolts the assembly will swallow. That number decides the quotation, the purchasing order, the cutting list and the delivery date. Everything downstream inherits whatever error it contains.

So the obvious thing to do is automate it. Read the DWG, extract the geometry, produce the bill of material. I have spent the better part of two years on that problem, and the lesson is not the one I expected.

A drawing is not a model

The first instinct is to treat the DWG as a database. Open it, walk the entities, sum the lengths. That works for about ten minutes, until you meet a real production drawing.

In a real drawing, a 6 metre tube may be drawn as a single LINE, or as a POLYLINE with four vertices, or as a BLOCK inserted twice with a mirror transform, or as a rectangle that only means a tube because of a text label sitting next to it. The same assembly may be drawn at 1:1 in one file and at 1:20 in another. Dimensions get overridden by hand when someone fixes a length without moving the geometry. Layers carry meaning that exists nowhere except in the head of the person who set them up.

None of this is sloppiness. It is what happens when a drawing is made to be read by a person who already understands the product. The drawing is a communication artefact, not a data structure. Treating it as the latter is where most take-off automation quietly fails.

What actually works

Three things moved the needle for me, and none of them is clever.

Constrain the input before parsing it

The single highest-leverage change was not in the code. It was agreeing, with the people who draw, on a small set of rules: these layers mean structural profile, that block name means a purchased part, this attribute carries the part code. Four or five rules, written down, applied to new drawings.

A parser against a convention is a weekend of work. A parser against arbitrary drawings is an unbounded research project. The engineering judgment is knowing which one you are being asked for.

Classify by family, not by geometry

Trying to infer "this is a 40×60×2 rectangular tube" from line positions is fragile. Matching a normalised block name or layer token against a material catalogue is not. Once the family is known, the geometry only has to answer one question — how long — and that question is far more forgiving.

The practical consequence is that the material catalogue becomes the centre of the system, not the parser. Get the catalogue right and the take-off mostly falls out of it.

Never produce a silent number

This is the one I would tell my past self first. An automated take-off that outputs a confident total is worse than no take-off at all, because nobody checks a confident total.

Every line in the output should be traceable back to what produced it, and anything the system could not classify should appear as an explicit unresolved item rather than being dropped. The engineer's hour does not disappear; it moves from counting to reviewing. That is the actual win, and it is a large one — reviewing a hundred-line list takes ten minutes, producing it took two hours.

The part nobody mentions

Fasteners. Bolts, nuts, washers, the clips that hold the film. They are rarely drawn individually, they are a significant share of the purchase order, and they are the first thing to run out on site.

Geometry will not tell you how many bolts a frame needs. The only thing that works is a rule tied to the connection type: this joint pattern implies this count per metre, this profile family implies that spacing. Those rules come out of the people who assemble the thing, not out of the drawing. Collecting them is an afternoon of asking questions on site, and it is the highest value afternoon in the whole project.

Where it leaves you

A take-off system that is honest about its limits ends up looking less like artificial intelligence and more like a very patient assistant: it reads what it is confident about, flags what it is not, and remembers every material code so the engineer does not have to. The quotation goes out the same day instead of the next one. The cutting list matches what arrives at the laser.

That is unglamorous, and it is the whole value.

Çalıştığım her imalat atölyesinde aynı darboğaz vardı ve hiçbirinde makineler değildi. Darboğaz, bir mühendisin elinde çizim ve bir Excel dosyasıyla geçirdiği bir iki saat: profilleri sayar, metrelerce boru toplar, montajın kaç cıvata yutacağını tahmin eder. O sayı teklifi, satın alma siparişini, kesim listesini ve teslim tarihini belirler. Aşağıdaki her şey o sayının içindeki hatayı miras alır.

Yapılacak bariz şey bunu otomatikleştirmek. DWG'yi oku, geometriyi çıkar, metrajı üret. Bu problemin üzerinde iki yılın büyük kısmını geçirdim ve çıkan ders beklediğim ders değildi.

Çizim bir model değildir

İlk içgüdü DWG'yi bir veritabanı gibi görmek. Aç, varlıkları gez, uzunlukları topla. Bu yaklaşım yaklaşık on dakika çalışır — gerçek bir üretim çizimiyle karşılaşana kadar.

Gerçek bir çizimde 6 metrelik bir boru tek bir LINE olarak çizilmiş olabilir; ya da dört köşeli bir POLYLINE, ya da ayna dönüşümüyle iki kez yerleştirilmiş bir BLOCK, ya da yalnızca yanındaki metin etiketi sayesinde boru anlamına gelen bir dikdörtgen. Aynı montaj bir dosyada 1:1, başka bir dosyada 1:20 çizilmiş olabilir. Biri uzunluğu düzeltirken geometriyi kaydırmadığı için ölçüler elle ezilir. Katmanların taşıdığı anlam, onları kuran kişinin kafasından başka hiçbir yerde yazmaz.

Bunların hiçbiri özensizlik değil. Bir çizim, ürünü zaten bilen bir insan tarafından okunmak üzere yapıldığında olan şey bu. Çizim bir iletişim nesnesidir, bir veri yapısı değil. Onu veri yapısı sanmak, metraj otomasyonlarının çoğunun sessizce çöktüğü yer.

Pratikte ne işe yarıyor

Üç şey gerçekten fark yarattı ve hiçbiri zekice değil.

Ayrıştırmadan önce girdiyi sınırla

En yüksek kaldıraçlı değişiklik kodda değildi. Çizim yapan kişilerle küçük bir kurallar kümesinde anlaşmaktı: şu katmanlar yapısal profil demek, şu blok adı satın alınan parça demek, şu öznitelik parça kodunu taşıyor. Dört beş kural, yazıya dökülmüş, yeni çizimlere uygulanmış.

Bir kurala karşı ayrıştırıcı yazmak bir hafta sonudur. Rastgele çizimlere karşı ayrıştırıcı yazmak sonu olmayan bir araştırma projesidir. Mühendislik kararı, hangisinin istendiğini bilmektir.

Geometriye göre değil, aileye göre sınıflandır

Çizgi konumlarından "bu 40×60×2 kutu profil" sonucunu çıkarmaya çalışmak kırılgandır. Normalize edilmiş bir blok adını veya katman belirtecini malzeme kataloğuyla eşleştirmek değildir. Aile bilindikten sonra geometrinin cevaplaması gereken tek soru kalır — kaç metre — ve bu soru çok daha affedicidir.

Pratik sonucu şu: sistemin merkezi ayrıştırıcı değil, malzeme kataloğu olur. Kataloğu doğru kurarsanız metraj büyük ölçüde kendiliğinden çıkar.

Asla sessiz bir sayı üretme

Geçmişteki kendime ilk söyleyeceğim şey bu. Kendinden emin bir toplam veren otomatik metraj, hiç metraj olmamasından kötüdür — çünkü kimse kendinden emin bir toplamı kontrol etmez.

Çıktıdaki her satır, onu üreten şeye kadar geri izlenebilmeli; sistemin sınıflandıramadığı her şey sessizce düşmek yerine açıkça "çözülmedi" olarak görünmeli. Mühendisin bir saati yok olmuyor; saymaktan kontrol etmeye kayıyor. Asıl kazanç bu ve küçük bir kazanç değil — yüz satırlık bir listeyi kontrol etmek on dakika, onu üretmek iki saat sürüyordu.

Kimsenin bahsetmediği kısım

Bağlantı elemanları. Cıvata, somun, pul, örtüyü tutan klipsler. Nadiren tek tek çizilirler, satın alma siparişinin ciddi bir kısmını oluştururlar ve sahada ilk tükenen şeydir.

Bir çerçevenin kaç cıvata istediğini geometri söylemez. İşe yarayan tek şey, bağlantı tipine bağlı bir kuraldır: şu birleşim deseni metrede şu adedi gerektirir, şu profil ailesi şu aralığı ister. Bu kurallar çizimden değil, o şeyi monte eden insanlardan çıkar. Onları toplamak sahada soru sormakla geçen bir öğleden sonradır ve projenin en değerli öğleden sonrasıdır.

Nereye varıyor

Sınırları konusunda dürüst olan bir metraj sistemi, sonunda yapay zekâdan çok çok sabırlı bir asistana benziyor: emin olduğu şeyi okuyor, olmadığını işaretliyor ve bütün malzeme kodlarını mühendis yerine hatırlıyor. Teklif ertesi gün yerine aynı gün çıkıyor. Kesim listesi lazere giden şeyle tutuyor.

Bu hiç gösterişli değil ve bütün değer tam olarak burada.

← All writing← Bütün yazılar