Onikigen (EPDK) Çizim Makrosu (Dodecagon (EPDK) Drawing Macro)

PRO/epdk_onikigen_cizimi

sabangul67@gmail.com
Mayıs 17, 20254 dk okuma2 görüntülenme

Netcad ile 12gen (EPDK) Otomatik Çokgen Çizimi için VBScript Makrosu

VBScript Macro for Automatic Dodecagon (EPDK) Drawing in Netcad


Bu makro, Netcad yazılımında EPDK (Enerji Piyasası Düzenleme Kurumu) standartlarına uygun 12 kenarlı çokgen (onikigen) çizimi yapan bir VBScript kodudur. Kullanıcı tarafından seçilen noktalar etrafında, 700 birim mesafede 12 eşit aralıklı nokta oluşturur ve bu noktaları birleştirerek dolgulu bir çokgen çizer. Her nokta numaralandırılır ve çizimler \”_cizciz\”, \”_ciznok\” ve \”COKGEN\” katmanlarına kaydedilir. Özellikle enerji sektörü projelerinde, haritacılık ve teknik çizimlerde EPDK uyumlu planlamalar için idealdir. Makro, tekrarlayan çizim süreçlerini otomatikleştirerek zaman tasarrufu sağlar ve hata riskini azaltır. 🛠️

This macro is a VBScript code that draws a 12-sided polygon (dodecagon) compliant with EPDK (Energy Market Regulatory Authority) standards in Netcad software. It generates 12 equally spaced points at a 700-unit distance around user-selected points and connects them to form a filled polygon. Each point is numbered, and drawings are saved to \”_cizciz\”, \”_ciznok\”, and \”COKGEN\” layers. Ideal for energy sector projects, cartography, and technical drawings, it automates repetitive tasks, saving time and reducing errors. 🛠️


Nasıl Çalışır (How Does It Work)

  • Kullanıcı, Netcad arayüzünde EPDK projelerine uygun noktaları seçer.
  • Makro, her seçilen noktanın etrafında 700 birim mesafede 12 nokta hesaplar. Trigonometrik fonksiyonlar (sin ve cos) kullanılarak noktalar dairesel bir düzende yerleştirilir.
  • Her nokta için bir çizgi ve numaralandırılmış bir nokta objesi oluşturulur.
  • Noktalar ArrayList yapısında saklanır ve bu koordinatlar kullanılarak kapalı, dolgulu bir 12gen çizilir.
  • Çizimler, \”_cizciz\” (çizgiler), \”_ciznok\” (noktalar) ve \”COKGEN\” (çokgen) katmanlarına organize bir şekilde kaydedilir. Makro, seçim setini yeniler ve ekranı güncelleyerek işlemi tamamlar.
  • Bu süreç, EPDK projelerinde hızlı ve standartlara uygun çizim sağlar.
  • The user selects points in the Netcad interface suitable for EPDK projects.
  • The macro calculates 12 points at a 700-unit distance around each selected point, using trigonometric functions (sin and cos) for circular placement.
  • A line and a numbered point object are created for each point.
  • Points are stored in an ArrayList, and their coordinates are used to draw a closed, filled dodecagon.
  • Drawings are organized into \”_cizciz\” (lines), \”_ciznok\” (points), and \”COKGEN\” (polygon) layers.
  • The macro refreshes the selection set and updates the screen to complete the process.
  • This ensures fast, EPDK-compliant drawings. ⚙️


Etiket ( Labels )

Netcad, VBScript, Çokgen Çizimi, Otomatik Çizim, Haritacılık, Teknik Çizim, Makro Otomasyonu, Onikigen Çizimi, Katman Yönetimi, Nokta Çizimi, Trigonometrik Hesaplama, ArrayList Kullanımı, Çizim Otomasyonu, Mimarlık Planlama, Netcad Makro, Programlama, CAD Otomasyonu, Hızlı Çizim, Teknik Harita, Otomasyon Scripti

Netcad, VBScript, Polygon Drawing, Automatic Drawing, Cartography, Technical Drawing, Macro Automation, Dodecagon Drawing, Layer Management, Point Drawing, Trigonometric Calculation, ArrayList Usage, Drawing Automation, Architectural Planning, Netcad Macro, Programming, CAD Automation, Fast Drawing, Technical Mapping, Automation Script


📝 Netcad NVB Code

VB
Sub Main
Dim i,j,o,SEL,u
with Netcad
    set SEL = .NewSelectionSet
    set o = .NewObject
    if SEL.SELECT("Onikigen Çizilecek Noktaları Seçiniz. [SAGULCAD]",array(opoint)) then
        dim mesafe
        mesafe=700 'Çokgenin yarıçapı / Polygon radius
        dim y,x,h,f
        f=400/12
        pi= 3.14159265
        f= pi*f/200
        for i = 0 to SEL.NE-1
            j = SEL.GetSelectedObject(i, o)
            dim list1,list2
            Set list1 = CreateObject("System.Collections.ArrayList")
            list1.clear
            Set list2 = CreateObject("System.Collections.ArrayList")
            list2.clear
            for h=0 to 11
                y= o.p1.y + mesafe*sin(f*h) 'Nokta y koordinatı / Point y coordinate
                x=o.p1.x + mesafe*cos(f*h) 'Nokta x koordinatı / Point x coordinate
                set tx= .MakeLine(.newc(o.p1.y,o.p1.x,0), .newc(y,x,0),.createlayer("_cizciz",5),1,1)
                .addobject(tx)
                set tx1= .MakePoint (.newc(y,x,0), h+1, h+1, .createlayer("_ciznok",5))
                .addobject(tx1)
                list1.add (y)
                list2.add (x)
            next
            dim r
            set pol = .NewPoly
            for r=0 to list1.count-1
                pol.AddCoor(.NewC(list1(r),list2(r),0)) 'Çokgen koordinatları / Polygon coordinates
            next
            set olustur = .MakePline("sagul",POLYCLOSED+POLYFILLED,0,.createlayer("COKGEN",7),0,0,pol)
            .AddObject olustur
            .putobject j, o
        next
        SEL.RedrawAndRewind
        set u=.GetCurrentWindow
        .SetCurrentWindow u,1
    end if
    set u=nothing
    set SEL = nothing
    set o = nothing
end with
end sub
VB

PRO/epdk_onikigen_cizimi

Yazar

sabangul67@gmail.com

Bu yazarın yayınladığı diğer içerikleri inceleyebilirsiniz.

Tüm yazıları